Use clock_gettime() for better timestamps on platforms that support it

This commit is contained in:
Cameron Gutman 2017-06-10 12:07:25 -07:00
parent c01deff683
commit af6f13c7fa

View File

@ -292,6 +292,12 @@ int PltWaitForEvent(PLT_EVENT* event) {
uint64_t PltGetMillis(void) {
#if defined(LC_WINDOWS)
return GetTickCount64();
#elif HAVE_CLOCK_GETTIME
struct timespec tv;
clock_gettime(CLOCK_MONOTONIC, &tv);
return (tv.tv_sec * 1000) + (tv.tv_nsec / 1000000);
#else
struct timeval tv;