[Core] Added a wait before a spin wait.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5869 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nodchip 2010-07-11 03:16:52 +00:00
parent addb89fecc
commit 3997243143
1 changed files with 6 additions and 0 deletions

View File

@ -626,6 +626,12 @@ void VideoThrottle()
{
// Make the limiter a bit loose
u32 frametime = ((SConfig::GetInstance().b_UseFPS)? Common::AtomicLoad(DrawnFrame) : DrawnVideo) * 1000 / TargetVPS;
u32 timeDifference = (u32)Timer.GetTimeDifference();
if (timeDifference < frametime) {
Common::SleepCurrentThread(frametime - timeDifference - 1);
}
while ((u32)Timer.GetTimeDifference() < frametime)
Common::YieldCPU();
//Common::SleepCurrentThread(1);