26 # define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 27 # define timeradd(a, b, result) \ 29 (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ 30 (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ 31 if ((result)->tv_usec >= 1000000) \ 34 (result)->tv_usec -= 1000000; \ 37 # define timersub(a, b, result) \ 39 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ 40 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ 41 if ((result)->tv_usec < 0) { \ 43 (result)->tv_usec += 1000000; \ int osal_gettimeofday(struct timeval *tv, struct timezone *tz)