[host] windows: add delayExecution function for more accurate sleeps

This change not only exposes and allows use of NtDelayExecution, but
also moves the code to set the system timer resolution.
This commit is contained in:
Geoffrey McRae committed 2021-07-17 14:55:22 +10:00
1 parent e228165ff9
commit 411a6b1e49
6 files changed
+105 -14

No files matched your search

+2 -1
View File
@@ -19,6 +19,7 @@
*/
#include "windows/mousehook.h"
#include "windows/delay.h"
#include "common/windebug.h"
#include "platform.h"
@@ -104,7 +105,7 @@ static DWORD WINAPI updateThreadProc(LPVOID lParam)
mouseHook.callback(mouseHook.x, mouseHook.y);
// limit this to 1000Hz, who has a mouse that updates faster anyway?
Sleep(1);
delayExecution(1.0f);
break;
}
}