35 static inline uint32_t
convertToMs(
const struct timeval* time)
37 return (uint32_t) (time->tv_sec * 1000 + time->tv_usec / 1000);
40 static inline uint32_t
convertToMs(
const struct timespec* time)
42 return (uint32_t) (time->tv_sec * 1000 + time->tv_nsec / 1000000);
47 struct timespec curTime;
48 ::clock_gettime(CLOCK_MONOTONIC, &curTime);
59 static inline int curTime(
struct timespec* time)
61 return ::clock_gettime(CLOCK_MONOTONIC, time);
64 static inline int curTime(
struct timeval* time)
66 struct timespec tsTime;
68 time->tv_sec = tsTime.tv_sec;
69 time->tv_usec = tsTime.tv_nsec / 1000;
76 struct timeval currTime;
77 ::gettimeofday(&currTime, NULL);