diff options
author | nicm <nicm> | 2020-06-02 08:17:27 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-06-02 08:17:27 +0000 |
commit | f3931497f8aee291bce132fb106cedb55c5b3fa9 (patch) | |
tree | 2acdacdac20714ab521508b93e362e35478ea06a /window-copy.c | |
parent | 563b7331da2d31aca470389817c282a46da7c872 (diff) | |
download | rtmux-f3931497f8aee291bce132fb106cedb55c5b3fa9.tar.gz rtmux-f3931497f8aee291bce132fb106cedb55c5b3fa9.tar.bz2 rtmux-f3931497f8aee291bce132fb106cedb55c5b3fa9.zip |
Use CLOCK_MONOTONIC for timer measurement and add a timestamp to control
mode %output blocks.
Diffstat (limited to 'window-copy.c')
-rw-r--r-- | window-copy.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/window-copy.c b/window-copy.c index cfa91df9..af80186b 100644 --- a/window-copy.c +++ b/window-copy.c @@ -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; |