Home
last modified time | relevance | path

Searched refs:tv (Results 1 – 25 of 45) sorted by relevance

12

/libevent-2.1.12/
H A Devutil_time.c93 if (tv == NULL) in evutil_gettimeofday()
130 if (tv->tv_usec > 1000000 || tv->tv_sec > MAX_SECONDS_IN_MSEC_LONG) in evutil_tv_to_msec_()
133 return (tv->tv_sec * 1000) + ((tv->tv_usec + 999) / 1000); in evutil_tv_to_msec_()
143 if (!tv) in evutil_usleep_()
151 usec = tv->tv_sec * 1000000LL + tv->tv_usec; in evutil_usleep_()
173 sleep(tv->tv_sec); in evutil_usleep_()
174 usleep(tv->tv_usec); in evutil_usleep_()
232 struct timeval *tv) in adjust_monotonic_time() argument
234 evutil_timeradd(tv, &base->adjust_monotonic_clock, tv); in adjust_monotonic_time()
242 *tv = base->last_time; in adjust_monotonic_time()
[all …]
H A Devent.c428 struct timeval tv; in gettime() local
1094 if (base && tv) { in event_gettime_monotonic()
1500 tv.tv_sec += tv.tv_usec / 1000000; in event_base_init_common_timeout()
1502 duration = &tv; in event_base_init_common_timeout()
1772 evutil_timeradd(&base->max_dispatch_time, &tv, &tv); in event_process_active()
1773 endtime = &tv; in event_process_active()
1969 tv_p = &tv; in event_base_loop()
2076 if (tv == NULL || ! evutil_timerisset(tv)) { in event_base_once()
2729 ev, (int)tv->tv_sec, (int)tv->tv_usec, ev->ev_callback)); in event_add_nolock_()
3764 evutil_timeradd(&tv, &base->tv_clock_diff, &tv); in dump_inserted_event_fn()
[all …]
H A Devthread_win32.c157 evthread_win32_condvar_wait(void *cond_, void *lock_, const struct timeval *tv) in evthread_win32_condvar_wait() argument
164 if (tv) in evthread_win32_condvar_wait()
165 ms = evutil_tv_to_msec_(tv); in evthread_win32_condvar_wait()
233 evthread_win32_cond_wait(void *cond_, void *lock_, const struct timeval *tv) in evthread_win32_cond_wait() argument
241 if (tv) in evthread_win32_cond_wait()
242 ms_orig = ms = evutil_tv_to_msec_(tv); in evthread_win32_cond_wait()
H A Dtime-internal.h56 long evutil_tv_to_msec_(const struct timeval *tv);
58 void evutil_usleep_(const struct timeval *tv);
94 int evutil_gettime_monotonic_(struct evutil_monotonic_timer *mt, struct timeval *tv);
H A Depoll.c417 epoll_dispatch(struct event_base *base, struct timeval *tv) in epoll_dispatch() argument
429 if (tv == NULL) { in epoll_dispatch()
434 if (tv->tv_sec == 0 && tv->tv_usec == 0) { in epoll_dispatch()
439 is.it_value.tv_sec = tv->tv_sec; in epoll_dispatch()
440 is.it_value.tv_nsec = tv->tv_usec * 1000; in epoll_dispatch()
451 if (tv != NULL) { in epoll_dispatch()
452 timeout = evutil_tv_to_msec_(tv); in epoll_dispatch()
H A Ddevpoll.c168 devpoll_dispatch(struct event_base *base, struct timeval *tv) in devpoll_dispatch() argument
178 if (tv != NULL) in devpoll_dispatch()
179 timeout = tv->tv_sec * 1000 + (tv->tv_usec + 999) / 1000; in devpoll_dispatch()
H A Devthread-internal.h178 #define EVTHREAD_COND_WAIT_TIMED(cond, lock, tv) \ argument
179 ( (cond) ? evthread_cond_fns_.wait_condition((cond), (lock), (tv)) : 0 )
205 int evthreadimpl_cond_wait_(void *cond, void *lock, const struct timeval *tv);
300 #define EVTHREAD_COND_WAIT_TIMED(cond, lock, tv) \ argument
301 ( (cond) ? evthreadimpl_cond_wait_((cond), (lock), (tv)) : 0 )
H A Devthread_pthread.c137 evthread_posix_cond_wait(void *cond_, void *lock_, const struct timeval *tv) in evthread_posix_cond_wait() argument
143 if (tv) { in evthread_posix_cond_wait()
147 evutil_timeradd(&now, tv, &abstime); in evthread_posix_cond_wait()
H A Devport.c256 evport_dispatch(struct event_base *base, struct timeval *tv) in evport_dispatch() argument
277 if (tv != NULL) { in evport_dispatch()
278 ts.tv_sec = tv->tv_sec; in evport_dispatch()
279 ts.tv_nsec = tv->tv_usec * 1000; in evport_dispatch()
H A Devthread.c297 debug_cond_wait(void *cond_, void *lock_, const struct timeval *tv) in debug_cond_wait() argument
305 r = original_cond_fns_.wait_condition(cond_, lock->lock, tv); in debug_cond_wait()
489 evthreadimpl_cond_wait_(void *cond, void *lock, const struct timeval *tv) in evthreadimpl_cond_wait_() argument
492 return evthread_cond_fns_.wait_condition(cond, lock, tv); in evthreadimpl_cond_wait_()
H A Dwin32select.c280 win32_dispatch(struct event_base *base, struct timeval *tv) in win32_dispatch() argument
308 long msec = tv ? evutil_tv_to_msec_(tv) : LONG_MAX; in win32_dispatch()
322 (struct fd_set*)win32op->exset_out, tv); in win32_dispatch()
/libevent-2.1.12/test/
H A Dtest-time.c63 struct timeval tv; in time_cb() local
71 tv.tv_sec = 0; in time_cb()
72 tv.tv_usec = rand_int(50000); in time_cb()
73 if (tv.tv_usec % 2 || called < NEVENT) in time_cb()
74 evtimer_add(ev[j], &tv); in time_cb()
85 struct timeval tv; in main() local
107 tv.tv_sec = 0; in main()
108 tv.tv_usec = rand_int(50000); in main()
109 evtimer_add(ev[i], &tv); in main()
H A Dregress_thread.c113 struct timeval tv; in basic_thread() local
115 tv.tv_sec = 0; in basic_thread()
116 tv.tv_usec = 3000; in basic_thread()
149 struct timeval tv; in sigchld_cb() local
153 tv.tv_usec = 100000; in sigchld_cb()
154 tv.tv_sec = 0; in sigchld_cb()
171 struct timeval tv; in thread_basic() local
233 tv.tv_sec = 1000; in thread_basic()
234 event_add(&ev, &tv); in thread_basic()
395 struct timeval tv; in SLEEP_MS() local
[all …]
H A Dregress.c437 tv.tv_sec = 0; in test_simpleclose_rw()
444 tv.tv_sec = 0; in test_simpleclose_rw()
510 tv.tv_sec = 0; in test_simpleclose()
621 tv.tv_sec = 0; in test_simpletimeout()
726 tv.tv_sec = 0; in test_persistent_active_timeout()
2047 tv.tv_sec = 0; in test_loopexit()
2077 tv.tv_sec = 0; in test_loopexit_multiple()
2081 tv.tv_sec = 3; in test_loopexit_multiple()
2122 tv.tv_sec = 0; in test_loopbreak()
2492 tv.tv_sec = 1; in evtag_fuzz()
[all …]
H A Dtest-ratelim.c285 struct timeval tv = { 0, 1 }; in timer_bias_calculate() local
333 struct timeval tv; in test_ratelimiting() local
442 tv.tv_sec = cfg_duration - 1; in test_ratelimiting()
443 tv.tv_usec = 995000; in test_ratelimiting()
447 tv.tv_sec = 0; in test_ratelimiting()
448 tv.tv_usec = 100*1000; in test_ratelimiting()
477 tv.tv_sec = 0; in test_ratelimiting()
478 tv.tv_usec = 300000; in test_ratelimiting()
674 struct timeval tv; in main() local
677 srand(tv.tv_usec); in main()
[all …]
H A Dbench_cascade.c146 struct timeval *tv; in main() local
176 tv = run_once(num_pipes); in main()
177 if (tv == NULL) in main()
180 tv->tv_sec * 1000000L + tv->tv_usec); in main()
H A Dbench.c149 struct timeval *tv; local
227 tv = run_once();
228 if (tv == NULL)
231 tv->tv_sec * 1000000L + tv->tv_usec);
H A Dregress_http.c610 struct timeval tv; in http_delay_cb() local
612 tv.tv_sec = 0; in http_delay_cb()
687 struct timeval tv; in http_bad_request_test() local
717 timerclear(&tv); in http_bad_request_test()
751 timerclear(&tv); in http_bad_request_test()
1370 tv.tv_sec = 0; in http_request_error_cb_with_cancel()
1536 tv.tv_sec = 0; in http_cancel_test()
4251 tv.tv_sec = 0; in terminate_chunked_trickle_cb()
4288 tv.tv_sec = 0; in terminate_chunked_cb()
4351 &tv); in http_terminate_chunked_test_impl()
[all …]
H A Dtest-changelist.c169 struct timeval tv; in main() local
194 tv.tv_sec = 1; in main()
195 tv.tv_usec = 500*1000; in main()
197 evtimer_add(timeout, &tv); in main()
H A Dregress_util.c1396 struct timeval tv[10], delay; in test_evutil_monotonic_res() local
1428 evutil_gettime_monotonic_(&timer, &tv[i]); in test_evutil_monotonic_res()
1434 tt_assert(evutil_timercmp(&tv[i], &tv[i+1], <)); in test_evutil_monotonic_res()
1435 evutil_timersub(&tv[i+1], &tv[i], &diff); in test_evutil_monotonic_res()
1453 struct timeval tv[10]; in test_evutil_monotonic_prc() local
1466 evutil_gettime_monotonic_(&timer, &tv[0]); in test_evutil_monotonic_prc()
1469 evutil_gettime_monotonic_(&timer, &tv[i]); in test_evutil_monotonic_prc()
1470 } while (evutil_timercmp(&tv[i-1], &tv[i], ==)); in test_evutil_monotonic_prc()
1476 tt_assert(evutil_timercmp(&tv[i], &tv[i+1], <)); in test_evutil_monotonic_prc()
1477 evutil_timersub(&tv[i+1], &tv[i], &diff); in test_evutil_monotonic_prc()
H A Dregress_iocp.c93 struct timeval tv; in count_wait_for() local
99 tv.tv_sec = 0; in count_wait_for()
100 tv.tv_usec = ms * 1000; in count_wait_for()
102 EVTHREAD_COND_WAIT_TIMED(count_cond, count_lock, &tv); in count_wait_for()
H A Dbench_http.c188 struct timeval tv={99999999,0}; in main() local
189 event_base_loopexit(base, &tv); in main()
/libevent-2.1.12/sample/
H A Dtime-test.c59 struct timeval tv; in timeout_cb() local
60 evutil_timerclear(&tv); in timeout_cb()
61 tv.tv_sec = 2; in timeout_cb()
62 event_add(timeout, &tv); in timeout_cb()
70 struct timeval tv; in main() local
97 evutil_timerclear(&tv); in main()
98 tv.tv_sec = 2; in main()
99 event_add(&timeout, &tv); in main()
/libevent-2.1.12/include/event2/
H A Devent_compat.h198 #define timeout_add(ev, tv) event_add((ev), (tv)) argument
201 #define timeout_pending(ev, tv) event_pending((ev), EV_TIMEOUT, (tv)) argument
212 #define signal_add(ev, tv) event_add((ev), (tv)) argument
216 #define signal_pending(ev, tv) event_pending((ev), EV_SIGNAL, (tv)) argument
H A Devent.h967 #define evtimer_add(ev, tv) event_add((ev), (tv)) argument
969 #define evtimer_pending(ev, tv) event_pending((ev), EV_TIMEOUT, (tv)) argument
979 #define evsignal_add(ev, tv) event_add((ev), (tv)) argument
985 #define evsignal_pending(ev, tv) event_pending((ev), EV_SIGNAL, (tv)) argument
998 #define evuser_pending(ev, tv) event_pending((ev), 0, (tv)) argument
1307 int event_pending(const struct event *ev, short events, struct timeval *tv);
1634 struct timeval *tv);

12