mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 14:27:09 +00:00
Use CLOCK_MONOTONIC for timer measurement and add a timestamp to control
mode %output blocks.
This commit is contained in:
@ -2934,15 +2934,6 @@ window_copy_search(struct window_mode_entry *wme, int direction, int regex)
|
||||
return (found);
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
window_copy_get_time(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
return ((tv.tv_sec * 1000ULL) + (tv.tv_usec / 1000ULL));
|
||||
}
|
||||
|
||||
static int
|
||||
window_copy_search_marks(struct window_mode_entry *wme, struct screen *ssp,
|
||||
int regex)
|
||||
@ -2985,11 +2976,11 @@ window_copy_search_marks(struct window_mode_entry *wme, struct screen *ssp,
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
tstart = window_copy_get_time();
|
||||
tstart = get_timer();
|
||||
|
||||
start = 0;
|
||||
end = gd->hsize + gd->sy;
|
||||
stop = window_copy_get_time() + WINDOW_COPY_SEARCH_ALL_TIMEOUT;
|
||||
stop = get_timer() + WINDOW_COPY_SEARCH_ALL_TIMEOUT;
|
||||
|
||||
again:
|
||||
free(data->searchmark);
|
||||
@ -3027,7 +3018,7 @@ again:
|
||||
px++;
|
||||
}
|
||||
|
||||
t = window_copy_get_time();
|
||||
t = get_timer();
|
||||
if (t - tstart > WINDOW_COPY_SEARCH_TIMEOUT) {
|
||||
data->timeout = 1;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user