13 #define USECS_PER_SEC 1000000 21 QueryPerformanceFrequency((LARGE_INTEGER *)&
sysfrequency);
24 QueryPerformanceCounter((LARGE_INTEGER *)&wintime);
26 tv->tv_sec = (long)(usecs / 1000000);
27 tv->tv_usec = (long)(usecs - (tv->tv_sec * 1000000));
35 int64 system_time64, usecs;
45 int64 offset = -134774LL * 86400LL * 1000000LL * 10LL;
47 GetSystemTimeAsFileTime(&system_time);
49 system_time64 = ((
int64)(system_time.dwHighDateTime) << 32) + (
int64)system_time.dwLowDateTime;
50 system_time64 += offset;
51 usecs = system_time64 / 10;
53 tv->tv_sec = (long)(usecs / 1000000);
54 tv->tv_usec = (long)(usecs - (tv->tv_sec * 1000000));
61 struct timeval current_time;
65 return_value.sec = current_time.tv_sec;
66 return_value.usec = current_time.tv_usec;
84 struct timeval start_time;
85 struct timeval timeout;
86 struct timeval stop_time;
91 timeradd (&start_time, &timeout, &stop_time);
93 self->stop_time.sec = stop_time.tv_sec;
94 self->stop_time.usec = stop_time.tv_usec;
99 struct timeval current_time;
100 struct timeval stop_time;
101 int is_not_yet_expired;
104 stop_time.tv_sec =
self->stop_time.sec;
105 stop_time.tv_usec =
self->stop_time.usec;
106 is_not_yet_expired =
timercmp (¤t_time, &stop_time, <);
108 return is_not_yet_expired ==
FALSE;
117 SleepEx(usec / 1000,
FALSE);
135 *thandle = CreateThread(NULL, stacksize, func, param, 0, NULL);
149 ret = SetThreadPriority(*thandle, THREAD_PRIORITY_TIME_CRITICAL);
ec_timet osal_current_time(void)
int osal_usleep(uint32 usec)
void osal_free(void *ptr)
boolean osal_timer_is_expired(osal_timert *self)
int osal_getrelativetime(struct timeval *tv, struct timezone *tz)
int osal_gettimeofday(struct timeval *tv, struct timezone *tz)
#define timercmp(a, b, CMP)
#define timeradd(a, b, result)
void osal_time_diff(ec_timet *start, ec_timet *end, ec_timet *diff)
void osal_timer_start(osal_timert *self, uint32 timeout_usec)
static int64_t sysfrequency
void * osal_malloc(size_t size)
int osal_thread_create(void **thandle, int stacksize, void *func, void *param)
int osal_thread_create_rt(void **thandle, int stacksize, void *func, void *param)