26 #define USECS_PER_SEC 1000000 34 return nanosleep(&ts, NULL);
46 return_value = clock_gettime (CLOCK_MONOTONIC, &ts), 0;
47 tv->tv_sec = ts.tv_sec;
48 tv->tv_usec = ts.tv_nsec / 1000;
54 struct timeval current_time;
58 return_value.sec = current_time.tv_sec;
59 return_value.usec = current_time.tv_usec;
65 struct timeval start_time;
66 struct timeval timeout;
67 struct timeval stop_time;
72 timeradd (&start_time, &timeout, &stop_time);
74 self->stop_time.sec = stop_time.tv_sec;
75 self->stop_time.usec = stop_time.tv_usec;
80 struct timeval current_time;
81 struct timeval stop_time;
82 int is_not_yet_expired;
85 stop_time.tv_sec =
self->stop_time.sec;
86 stop_time.tv_usec =
self->stop_time.usec;
87 is_not_yet_expired =
timercmp (¤t_time, &stop_time, <);
89 return is_not_yet_expired ==
FALSE;
void osal_timer_start(osal_timert *self, uint32 timeout_usec)
#define timeradd(a, b, result)
int osal_gettimeofday(struct timeval *tv, struct timezone *tz)
boolean osal_timer_is_expired(osal_timert *self)
ec_timet osal_current_time(void)
#define timercmp(a, b, CMP)
int osal_usleep(uint32 usec)