win32: Tweak busy loop/sleep balance a bit.

This commit is contained in:
BearOso 2023-02-22 15:22:42 -06:00
parent daf4a60b65
commit 1907b9e25b
1 changed files with 2 additions and 6 deletions

View File

@ -3471,18 +3471,14 @@ int WINAPI WinMain(
}
}
}
else if ((PCEnd - PCStart) > PCFrameTime / 10)
else
{
auto time_left = ((PCFrameTime - (PCEnd - PCStart)) * 1000000 / PCBase) - 100;
auto time_left = ((PCFrameTime - (PCEnd - PCStart)) * 100000 / PCBase);
LARGE_INTEGER li;
li.QuadPart = -time_left;
SetWaitableTimer(throttle_timer, &li, 0, NULL, NULL, false);
WaitForSingleObject(throttle_timer, INFINITE);
}
else
{
Sleep(0);
}
#ifdef NETPLAY_SUPPORT
}