Use clock_gettime() for better timestamps on platforms that support it
This commit is contained in:
parent
c01deff683
commit
af6f13c7fa
1 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue