4 time_add(struct timeval *tv, long microseconds)
6 tv->tv_usec += microseconds;
7 while (tv->tv_usec >= 1000000) {
8 tv->tv_usec -= 1000000;
11 while (tv->tv_usec < 0) {
12 tv->tv_usec += 1000000;
18 time_compare(struct timeval *a, struct timeval *b)
21 if ((r = a->tv_sec - b->tv_sec)) return r;
22 return a->tv_usec - b->tv_usec;