mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-01-20 10:42:28 +00:00
[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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user