[host/common] windows: provide delayExecution via nsleep

This change moves this platform specific sleep to `common` as the OS
agnostic `nsleep` function.

Ref PR #661
This commit is contained in:
Geoffrey McRae
2021-07-26 16:36:56 +10:00
parent 120fe63c0f
commit 5f5f497cbd
9 changed files with 59 additions and 107 deletions

View File

@@ -19,8 +19,8 @@
*/
#include "windows/mousehook.h"
#include "windows/delay.h"
#include "common/windebug.h"
#include "common/time.h"
#include "platform.h"
#include <windows.h>
@@ -105,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?
delayExecution(1.0f);
nsleep(1000000);
break;
}
}