diff options
author | Thomas Adam <thomas@xteddy.org> | 2020-06-02 11:29:48 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2020-06-02 11:29:48 +0100 |
commit | 31a51cae1dc420281bd3c51c2f0521668ad4e25d (patch) | |
tree | 48699668aa6b89ee41a9960d871e05fa9304309c /tmux.c | |
parent | 191a836560f1b1996c4976eb496b27a6d428ba21 (diff) | |
parent | f3931497f8aee291bce132fb106cedb55c5b3fa9 (diff) | |
download | rtmux-31a51cae1dc420281bd3c51c2f0521668ad4e25d.tar.gz rtmux-31a51cae1dc420281bd3c51c2f0521668ad4e25d.tar.bz2 rtmux-31a51cae1dc420281bd3c51c2f0521668ad4e25d.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'tmux.c')
-rw-r--r-- | tmux.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -237,6 +237,20 @@ setblocking(int fd, int state) } } +uint64_t +get_timer(void) +{ + struct timespec ts; + + /* + * We want a timestamp in milliseconds suitable for time measurement, + * so prefer the monotonic clock. + */ + if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) + clock_gettime(CLOCK_REALTIME, &ts); + return ((ts.tv_sec * 1000ULL) + (ts.tv_nsec / 1000000ULL)); +} + const char * sig2name(int signo) { |