Improve time/sleep accuracy on Windows

It's now almost as good as Linux thanks to a Windows 8+ API.
This commit is contained in:
Justine Tunney 2023-11-18 01:57:44 -08:00
parent 72ac5f18d9
commit 8caf1b48a9
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
9 changed files with 76 additions and 31 deletions

View file

@ -59,7 +59,7 @@ uint32_t SleepEx(uint32_t dwMilliseconds, bool32 bAlertable);
void GetSystemTime(struct NtSystemTime *lpSystemTime);
bool32 SystemTimeToFileTime(const struct NtSystemTime *lpSystemTime,
struct NtFileTime *lpFileTime);
void GetSystemTimeAsFileTime(struct NtFileTime *); /* win8+ */
void GetSystemTimeAsFileTime(struct NtFileTime *);
void GetSystemTimePreciseAsFileTime(struct NtFileTime *); /* win8+ */
uint32_t WaitForSingleObject(int64_t hHandle, uint32_t dwMilliseconds);
@ -110,8 +110,8 @@ void TryAcquireSRWLockShared(intptr_t *);
uint64_t GetTickCount64(void);
bool32 QueryPerformanceFrequency(int64_t *lpFrequency);
bool32 QueryPerformanceCounter(int64_t *lpPerformanceCount);
bool32 QueryPerformanceFrequency(uint64_t *lpFrequency);
bool32 QueryPerformanceCounter(uint64_t *lpPerformanceCount);
bool32 GetSystemTimeAdjustment(uint32_t *lpTimeAdjustment,
uint32_t *lpTimeIncrement,
bool32 *lpTimeAdjustmentDisabled);