|
|
@ -812,6 +812,11 @@ void cgtime(struct timeval *tv) |
|
|
|
{ |
|
|
|
{ |
|
|
|
gettimeofday(tv, NULL); |
|
|
|
gettimeofday(tv, NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void timeval_to_cgtimer(cgtimer_t *cgt, const struct timeval *tv) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
timeval_to_spec(cgt, tv); |
|
|
|
|
|
|
|
} |
|
|
|
#else |
|
|
|
#else |
|
|
|
static void dtime_to_timeval(struct timeval *tv, DWORD dtime) |
|
|
|
static void dtime_to_timeval(struct timeval *tv, DWORD dtime) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -830,6 +835,16 @@ void cgtime(struct timeval *tv) |
|
|
|
//timeEndPeriod(1);
|
|
|
|
//timeEndPeriod(1);
|
|
|
|
dtime_to_timeval(tv, dtime); |
|
|
|
dtime_to_timeval(tv, dtime); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void timeval_to_dtime(DWORD *dtime, const struct timeval *tv) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
*dtime = tv->tv_sec * 1000 + tv->tv_usec / 1000; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void timeval_to_cgtimer(cgtimer_t *cgt, const struct timeval *tv) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
timeval_to_dtime(cgt, tv); |
|
|
|
|
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
void subtime(struct timeval *a, struct timeval *b) |
|
|
|
void subtime(struct timeval *a, struct timeval *b) |
|
|
|