mirror of https://github.com/snes9xgit/snes9x.git
win32: Tweak busy loop/sleep balance a bit.
This commit is contained in:
parent
daf4a60b65
commit
1907b9e25b
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue