Lines Matching refs:tv
69 evutil_gettimeofday(struct timeval *tv, struct timezone *tz) in evutil_gettimeofday() argument
90 if (tv == NULL) in evutil_gettimeofday()
100 tv->tv_sec = (long) (ft.ft_64 / UNITS_PER_SEC); in evutil_gettimeofday()
101 tv->tv_usec = (long) ((ft.ft_64 / UNITS_PER_USEC) % USEC_PER_SEC); in evutil_gettimeofday()
110 evutil_tv_to_msec_(const struct timeval *tv) in evutil_tv_to_msec_() argument
112 if (tv->tv_usec > 1000000 || tv->tv_sec > MAX_SECONDS_IN_MSEC_LONG) in evutil_tv_to_msec_()
115 return (tv->tv_sec * 1000) + ((tv->tv_usec + 999) / 1000); in evutil_tv_to_msec_()
123 evutil_usleep_(const struct timeval *tv) in evutil_usleep_() argument
125 if (!tv) in evutil_usleep_()
129 long msec = evutil_tv_to_msec_(tv); in evutil_usleep_()
135 ts.tv_sec = tv->tv_sec; in evutil_usleep_()
136 ts.tv_nsec = tv->tv_usec*1000; in evutil_usleep_()
141 sleep(tv->tv_sec); in evutil_usleep_()
142 usleep(tv->tv_usec); in evutil_usleep_()
144 select(0, NULL, NULL, NULL, tv); in evutil_usleep_()
187 struct timeval *tv) in adjust_monotonic_time() argument
189 evutil_timeradd(tv, &base->adjust_monotonic_clock, tv); in adjust_monotonic_time()
191 if (evutil_timercmp(tv, &base->last_time, <)) { in adjust_monotonic_time()
194 evutil_timersub(&base->last_time, tv, &adjust); in adjust_monotonic_time()
197 *tv = base->last_time; in adjust_monotonic_time()
199 base->last_time = *tv; in adjust_monotonic_time()