mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-10-20 15:27:24 +00:00
Use clock_gettime() for better timestamps on platforms that support it
This commit is contained in:
1 parent
c01deff683
commit
af6f13c7fa
1 file changed
+6
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user