/freebsd/contrib/ntp/include/ |
H A D | timevalops.h | 79 TVUTOTSF((tv)->tv_usec, (ts)->l_uf); \ 87 usec = (tv)->tv_usec; \ 88 if (((tv)->tv_sec < 0) || ((tv)->tv_usec < 0)) { \ 106 TSFTOTVU((ts)->l_uf, (tv)->tv_usec); \ 107 if ((tv)->tv_usec == 1000000) { \ 109 (tv)->tv_usec = 0; \ 119 ((x)->tv_usec >= 0 && (x)->tv_usec < MICROSECONDS) 151 if (x.tv_usec < -3l * MICROSECONDS || in normalize_tval() 152 x.tv_usec > 3l * MICROSECONDS ) { in normalize_tval() 153 z = x.tv_usec / MICROSECONDS; in normalize_tval() [all …]
|
/freebsd/contrib/tcpdump/ |
H A D | timeval-operations.h | 36 #define netdissect_timevalclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) 38 #define netdissect_timevalisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 42 ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ 48 (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ 50 if ((vvp)->tv_usec >= ND_NANO_PER_SEC) { \ 52 (vvp)->tv_usec -= ND_NANO_PER_SEC; \ 55 if ((vvp)->tv_usec >= ND_MICRO_PER_SEC) { \ 57 (vvp)->tv_usec -= ND_MICRO_PER_SEC; \ 65 (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ 66 if ((vvp)->tv_usec < 0) { \ [all …]
|
/freebsd/contrib/unbound/util/ |
H A D | timeval_func.c | 50 time_t end_usec = end->tv_usec; in timeval_subtract() 52 if(end_usec < start->tv_usec) { in timeval_subtract() 56 d->tv_usec = end_usec - start->tv_usec; in timeval_subtract() 66 d->tv_usec += add->tv_usec; in timeval_add() 67 if(d->tv_usec >= 1000000 ) { in timeval_add() 68 d->tv_usec -= 1000000; in timeval_add() 82 avg->tv_usec = 0; in timeval_divide() 86 avg->tv_usec = sum->tv_usec / d; in timeval_divide() 91 avg->tv_usec += (((long long)leftover)*((long long)1000000))/d; in timeval_divide() 94 if(avg->tv_usec < 0) in timeval_divide() [all …]
|
H A D | mini_event.c | 63 if(e->ev_timeout.tv_usec < f->ev_timeout.tv_usec) in mini_ev_cmp() 65 if(e->ev_timeout.tv_usec > f->ev_timeout.tv_usec) in mini_ev_cmp() 155 p->ev_timeout.tv_usec > now->tv_usec)) { in handle_timeouts() 158 if(now->tv_usec > p->ev_timeout.tv_usec) { in handle_timeouts() 160 wait->tv_usec = 1000000 - (now->tv_usec - in handle_timeouts() 161 p->ev_timeout.tv_usec); in handle_timeouts() 163 wait->tv_usec = p->ev_timeout.tv_usec in handle_timeouts() 164 - now->tv_usec; in handle_timeouts() 315 ev->ev_timeout.tv_usec = tv->tv_usec + now->tv_usec; in event_add() 316 while(ev->ev_timeout.tv_usec >= 1000000) { in event_add() [all …]
|
H A D | timehist.c | 56 if(v->tv_sec == 0 && v->tv_usec == 0) { in timestwo() 57 v->tv_usec = 1; in timestwo() 61 v->tv_usec *= 2; in timestwo() 62 if(v->tv_usec == 1024*1024) { in timestwo() 65 v->tv_usec = 0; in timestwo() 139 (int)hist->buckets[i].lower.tv_usec, in timehist_print() 141 (int)hist->buckets[i].upper.tv_usec, in timehist_print() 162 (int)hist->buckets[i].lower.tv_usec, in timehist_log() 164 (int)hist->buckets[i].upper.tv_usec, in timehist_log() 203 (double)hist->buckets[i].lower.tv_usec/1000000.; in timehist_quartile() [all …]
|
H A D | winsock_event.c | 59 if(e->ev_timeout.tv_usec < f->ev_timeout.tv_usec) in mini_ev_cmp() 61 if(e->ev_timeout.tv_usec > f->ev_timeout.tv_usec) in mini_ev_cmp() 177 p->ev_timeout.tv_usec > now->tv_usec)) { in handle_timeouts() 180 if(now->tv_usec > p->ev_timeout.tv_usec) { in handle_timeouts() 182 wait->tv_usec = 1000000 - (now->tv_usec - in handle_timeouts() 183 p->ev_timeout.tv_usec); in handle_timeouts() 185 wait->tv_usec = p->ev_timeout.tv_usec in handle_timeouts() 186 - now->tv_usec; in handle_timeouts() 189 (long long)wait->tv_sec, (int)wait->tv_usec); in handle_timeouts() 246 timeout = wait->tv_sec*1000 + wait->tv_usec/1000; in handle_select() [all …]
|
/freebsd/contrib/sendmail/include/sm/ |
H A D | time.h | 24 (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ 25 if ((vvp)->tv_usec < 0) \ 28 (vvp)->tv_usec += 1000000; \ 38 (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ 39 if ((vvp)->tv_usec >= 1000000) \ 42 (vvp)->tv_usec -= 1000000; \ 50 ((tvp)->tv_usec cmp (uvp)->tv_usec) : \
|
/freebsd/contrib/ntp/libntp/lib/isc/unix/ |
H A D | stdtime.c | 44 if (tv->tv_usec < 0) { in fix_tv_usec() 48 tv->tv_usec += US_PER_S; in fix_tv_usec() 49 } while (tv->tv_usec < 0); in fix_tv_usec() 50 } else if (tv->tv_usec >= US_PER_S) { in fix_tv_usec() 54 tv->tv_usec -= US_PER_S; in fix_tv_usec() 55 } while (tv->tv_usec >=US_PER_S); in fix_tv_usec() 80 INSIST(tv.tv_usec >= 0); in isc_stdtime_get() 82 INSIST(tv.tv_usec >= 0 && tv.tv_usec < US_PER_S); in isc_stdtime_get()
|
/freebsd/contrib/libpcap/ |
H A D | portability.h | 121 (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ 122 if ((result)->tv_usec >= 1000000) { \ 124 (result)->tv_usec -= 1000000; \ 132 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ 133 if ((result)->tv_usec < 0) { \ 135 (result)->tv_usec += 1000000; \
|
/freebsd/crypto/heimdal/lib/roken/ |
H A D | timeval.c | 49 if (t1->tv_usec < 0) { in timevalfix() 51 t1->tv_usec += 1000000; in timevalfix() 53 if (t1->tv_usec >= 1000000) { in timevalfix() 55 t1->tv_usec -= 1000000; in timevalfix() 67 t1->tv_usec += t2->tv_usec; in timevaladd() 79 t1->tv_usec -= t2->tv_usec; in timevalsub()
|
/freebsd/contrib/sendmail/libsm/ |
H A D | clock.c | 109 ival.tv_usec = (intvl - ival.tv_sec * 1000) * 10; 168 itime.it_interval.tv_usec = 0; 171 if (itime.it_value.tv_sec == 0 && itime.it_value.tv_usec == 0) 172 itime.it_value.tv_usec = 1000; 238 clr.it_interval.tv_usec = 0; 240 clr.it_value.tv_usec = 0; 269 clr.it_interval.tv_usec = 0; in sm_clear_events() 271 clr.it_value.tv_usec = 0; in sm_clear_events() 334 clr.it_interval.tv_usec = 0; 336 clr.it_value.tv_usec = 0; [all …]
|
/freebsd/tests/sys/kern/acct/ |
H A D | acct_test.c | 82 tv.tv_usec = 0; in ATF_TC_BODY() 113 tv.tv_usec = 0; in ATF_TC_BODY() 116 (float)tv.tv_sec * AHZ + tv.tv_usec, v); in ATF_TC_BODY() 130 tv.tv_usec = 1; in ATF_TC_BODY() 133 (float)tv.tv_sec * AHZ + tv.tv_usec, v); in ATF_TC_BODY() 147 tv.tv_usec = 999999L; in ATF_TC_BODY() 150 (float)tv.tv_sec * AHZ + tv.tv_usec, v); in ATF_TC_BODY() 166 tv.tv_usec = 1000000L; in ATF_TC_BODY() 169 (float)tv.tv_sec * AHZ + tv.tv_usec, v); in ATF_TC_BODY() 186 tv.tv_usec = 999999L; in ATF_TC_BODY() [all …]
|
/freebsd/contrib/netbsd-tests/lib/libc/sys/ |
H A D | t_getitimer.c | 73 if (it.it_value.tv_sec != 0 || it.it_value.tv_usec != 0) in ATF_TC_BODY() 78 if (it.it_value.tv_sec != 0 || it.it_value.tv_usec != 0) in ATF_TC_BODY() 83 if (it.it_value.tv_sec != 0 || it.it_value.tv_usec != 0) in ATF_TC_BODY() 123 it.it_value.tv_usec = 100; in ATF_TC_BODY() 126 it.it_interval.tv_usec = 0; in ATF_TC_BODY() 182 it.it_value.tv_usec = 3; in ATF_TC_BODY() 185 it.it_interval.tv_usec = 0; in ATF_TC_BODY() 190 it.it_value.tv_usec = 1; in ATF_TC_BODY() 193 it.it_interval.tv_usec = 0; in ATF_TC_BODY() 199 (ot.it_value.tv_sec == 4 && ot.it_value.tv_usec <= 3), in ATF_TC_BODY() [all …]
|
/freebsd/usr.sbin/bluetooth/btpand/ |
H A D | event.c | 100 timeout.tv_usec = 0; in __event_dispatch() 116 t.tv_sec = t.tv_usec = 0; in __event_dispatch() 274 a->tv_usec += b->tv_usec; in tv_add() 276 if(a->tv_usec >= 1000000) { in tv_add() 277 a->tv_usec -= 1000000; in tv_add() 285 if (a->tv_usec < b->tv_usec) { in tv_sub() 286 a->tv_usec += 1000000; in tv_sub() 290 a->tv_usec -= b->tv_usec; in tv_sub() 303 if (a->tv_usec > b->tv_usec) in tv_cmp() 306 if (a->tv_usec < b->tv_usec) in tv_cmp()
|
/freebsd/usr.bin/systat/ |
H A D | keyboard.c | 59 intvl.tv_usec = delay % 1000000; in keyboard() 67 tm.tv_usec = last.tv_usec + intvl.tv_usec - now.tv_usec; in keyboard() 68 while (tm.tv_usec < 0) { in keyboard() 69 tm.tv_usec += 1000000; in keyboard() 72 while (tm.tv_usec >= 1000000) { in keyboard() 73 tm.tv_usec -= 1000000; in keyboard() 101 intvl.tv_usec = delay % 1000000; in keyboard()
|
/freebsd/usr.bin/ktrace/ |
H A D | subr.c | 105 t1->tv_usec += t2->tv_usec; in timevaladd() 113 t1->tv_usec -= t2->tv_usec; in timevalsub() 120 if (t1->tv_usec < 0) { in timevalfix() 122 t1->tv_usec += 1000000; in timevalfix() 124 if (t1->tv_usec >= 1000000) { in timevalfix() 126 t1->tv_usec -= 1000000; in timevalfix()
|
/freebsd/contrib/ntp/clockstuff/ |
H A D | chutest.c | 254 difftv.tv_usec = tv.tv_usec - lasttv.tv_usec; in process_raw() 255 if (difftv.tv_usec < 0) { in process_raw() 257 difftv.tv_usec += 1000000; in process_raw() 260 c, tv.tv_sec, tv.tv_usec, difftv.tv_sec, in process_raw() 261 difftv.tv_usec); in process_raw() 298 diff.tv_usec = tv->tv_usec in raw_filter() 299 - chudata.codetimes[chudata.ncodechars].tv_usec; in raw_filter() 300 if (diff.tv_usec < 0) { in raw_filter() 302 diff.tv_usec += 1000000; in raw_filter() 330 chudata.codetimes[i].tv_usec, in raw_filter() [all …]
|
/freebsd/contrib/ntp/util/ |
H A D | precision.c | 74 last = tp.tv_usec; in default_get_resolution() 77 diff = tp.tv_usec - last; in default_get_resolution() 80 last = tp.tv_usec; in default_get_resolution() 136 tp.tv_usec = ts.tv_nsec / 1000; in default_get_precision() 140 last = tp.tv_usec; in default_get_precision() 145 tp.tv_usec = ts.tv_nsec / 1000; in default_get_precision() 149 diff = tp.tv_usec - last; in default_get_precision() 150 last = tp.tv_usec; in default_get_precision()
|
H A D | testrs6000.c | 31 value.it_interval.tv_usec = value.it_value.tv_usec = 0; in main() 33 adjustment.tv_usec = -2000; in main() 51 if (result.tv_sec != 0 || result.tv_usec != 0) { in timeout() 53 (int) result.tv_usec); in timeout()
|
/freebsd/contrib/ntp/libntp/lib/isc/pthreads/ |
H A D | mutex.c | 46 #define timevalclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) 50 (vvp)->tv_usec += (uvp)->tv_usec; \ 51 if ((vvp)->tv_usec >= 1000000) { \ 53 (vvp)->tv_usec -= 1000000; \ 59 (vvp)->tv_usec -= (uvp)->tv_usec; \ 60 if ((vvp)->tv_usec < 0) { \ 62 (vvp)->tv_usec += 1000000; \ 215 stats[i].locked_total.tv_usec, in isc_mutex_statsprofile() 217 stats[i].wait_total.tv_usec, in isc_mutex_statsprofile() 226 locker->locked_total.tv_usec, in isc_mutex_statsprofile() [all …]
|
/freebsd/sys/sys/ |
H A D | time.h | 325 _tv->tv_usec = __utime64_scale64_floor( in bintime2timeval() 335 (uint64_t)_tv->tv_usec << 32, 1ULL << 32, 1000000); in timeval2bintime() 361 _tv.tv_usec = sbttous((uint32_t)_sbt); in sbttotv() 369 return (((sbintime_t)_tv.tv_sec << 32) + ustosbt(_tv.tv_usec)); in tvtosbt() 425 #define timevalclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) 426 #define timevalisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 429 ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ 438 #define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) 439 #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 442 ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ [all …]
|
/freebsd/sys/netinet/ |
H A D | tcp_hpts.c | 259 (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ 260 if ((vvp)->tv_usec < 0) { \ 262 (vvp)->tv_usec += 1000000; \ 970 tv.tv_usec = 0; in tcp_hpts_insert_diag() 975 tv.tv_usec = need_new_to; in tcp_hpts_insert_diag() 1576 hpts->p_mysleep.tv_usec /= 2; in __tcp_run_hpts() 1577 if (hpts->p_mysleep.tv_usec < dynamic_min_sleep) in __tcp_run_hpts() 1578 hpts->p_mysleep.tv_usec in __tcp_run_hpts() [all...] |
/freebsd/contrib/tcsh/ |
H A D | sh.time.c | 296 (r1->ru_utime.tv_usec - r0->ru_utime.tv_usec) / 10000 + in prusage() 298 (r1->ru_stime.tv_usec - r0->ru_stime.tv_usec) / 10000; in prusage() 304 (r1->ps_utime.tv_usec - r0->ps_utime.tv_usec) / 10000 + in prusage() 306 (r1->ps_stime.tv_usec - r0->ps_stime.tv_usec) / 10000; in prusage() 331 ((e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000); in prusage() 338 ((e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000); in prusage() 691 xprintf("%lld.%03ld", (long long)td.tv_sec, (long)td.tv_usec / 1000L); in pdeltat() 699 tsum->tv_usec += t0->tv_usec; in tvadd() 700 if (tsum->tv_usec >= 1000000) in tvadd() 701 tsum->tv_sec++, tsum->tv_usec -= 1000000; in tvadd() [all …]
|
/freebsd/contrib/ntp/libntp/ |
H A D | systime.c | 153 tsp->tv_nsec = tv.tv_usec * 1000; in get_ostime() 332 adjtv.tv_usec = (long)(ticks * quant * 1.e6 + .5); in adj_systime() 337 if (adjtv.tv_usec >= 1000000) { in adj_systime() 339 adjtv.tv_usec -= 1000000; in adj_systime() 343 sys_residual = dtemp - adjtv.tv_usec * 1.e-6; in adj_systime() 352 adjtv.tv_usec = -adjtv.tv_usec; in adj_systime() 355 if (adjtv.tv_sec != 0 || adjtv.tv_usec != 0) { in adj_systime() 554 tvlast.tv_usec = (timets.tv_nsec + 500) / 1000; in step_systime() 613 (u_int)ptv->tv_usec); in tv_fmt_libbuf() [all...] |
/freebsd/contrib/ntp/parseutil/ |
H A D | dcfd.c | 90 if ((_a_)->tv_usec >= 1000000) \ 92 (_a_)->tv_sec += (_a_)->tv_usec / 1000000; \ 93 (_a_)->tv_usec = (_a_)->tv_usec % 1000000; \ 95 if ((_a_)->tv_usec < 0) \ 97 (_a_)->tv_sec -= 1 + (-(_a_)->tv_usec / 1000000); \ 98 (_a_)->tv_usec = 999999 - (-(_a_)->tv_usec - 1); \ 106 (_a_)->tv_usec += (_b_)->tv_usec; \ 114 (_a_)->tv_usec -= (_b_)->tv_usec; \ 917 (val->tv_usec < 0) ? '-' : '+', in pr_timeval() 918 (long int)l_abs(val->tv_usec)); in pr_timeval() [all …]
|