13 #include <sys/timeb.h> 44 *date_ = *localtime(&tin);
46 if (secs_ !=
nullptr) secs_[0] = tp.time;
62 gettimeofday(&tv,
nullptr);
63 tp.tv_sec = tv.tv_sec;
64 tp.tv_nsec = tv.tv_usec * 1000;
67 clock_gettime(CLOCK_REALTIME, &tp);
70 if (date_ !=
nullptr) localtime_r(&tp.tv_sec, date_);
72 if (secs_ !=
nullptr) secs_[0] = tp.tv_sec;
87 clock_t
end = clock() + (CLOCKS_PER_SEC / 1000) * ms;
90 while ((diff =
end - clock()) > 0)
92 diff = (1000 * diff) / CLOCKS_PER_SEC;
94 std::this_thread::sleep_for(std::chrono::milliseconds(diff / 1000));
#define XSENS_SEC_PER_DAY
The number of seconds in a normal day.
TimeStamp timeStampNow(void)
void msleep(uint32_t ms)
A platform-independent sleep routine.
uint64_t TimeStamp
A real-time timestamp (ms)
The namespace of all Xsens software since 2006.
unsigned __int32 uint32_t
uint32_t getTimeOfDay(tm *date_, time_t *secs_)
A platform-independent clock.