mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
Use CLOCK_MONOTONIC for timer measurement and add a timestamp to control
mode %output blocks.
This commit is contained in:
14
tmux.c
14
tmux.c
@ -240,6 +240,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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user