mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-07-02 15:56:02 +00:00
Assume the platform supports clock_gettime() if CLOCK_MONOTONIC is defined
This commit is contained in:
parent
9e52b70edf
commit
6d767a8494
@ -600,8 +600,6 @@ int LiSendScrollEvent(signed char scrollClicks);
|
||||
int LiSendHighResScrollEvent(short scrollAmount);
|
||||
|
||||
// This function returns a time in milliseconds with an implementation-defined epoch.
|
||||
// NOTE: This will be populated from gettimeofday() if !HAVE_CLOCK_GETTIME and
|
||||
// populated from clock_gettime(CLOCK_MONOTONIC) if HAVE_CLOCK_GETTIME.
|
||||
uint64_t LiGetMillis(void);
|
||||
|
||||
// This is a simplistic STUN function that can assist clients in getting the WAN address
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user