mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-11-30 09:44:28 +00:00
Assume the platform supports clock_gettime() if CLOCK_MONOTONIC is defined
This commit is contained in:
1 parent
9e52b70edf
commit
6d767a8494
2 files changed
+3
-5
No files matched your search
+3
-3
@@ -396,11 +396,11 @@ void PltWaitForConditionVariable(PLT_COND* cond, PLT_MUTEX* mutex) {
|
||||
uint64_t PltGetMillis(void) {
|
||||
#if defined(LC_WINDOWS)
|
||||
return GetTickCount64();
|
||||
#elif HAVE_CLOCK_GETTIME
|
||||
#elif defined(CLOCK_MONOTONIC) && !defined(NO_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