Lines Matching refs:tv
43 fix_tv_usec(struct timeval *tv) {
46 if (tv->tv_usec < 0) {
49 tv->tv_sec -= 1;
50 tv->tv_usec += US_PER_S;
51 } while (tv->tv_usec < 0);
52 } else if (tv->tv_usec >= US_PER_S) {
55 tv->tv_sec += 1;
56 tv->tv_usec -= US_PER_S;
57 } while (tv->tv_usec >=US_PER_S);
69 struct timeval tv;
78 RUNTIME_CHECK(gettimeofday(&tv, NULL) != -1);
81 fix_tv_usec(&tv);
82 INSIST(tv.tv_usec >= 0);
84 INSIST(tv.tv_usec >= 0 && tv.tv_usec < US_PER_S);
87 *t = (unsigned int)tv.tv_sec;