Cocoa Port: In RunCoreThread(), don’t use a potentially more expensive wait method before doing a cheaper time comparison first.

This commit is contained in:
rogerman 2017-12-07 21:01:59 -08:00
parent bac10c7618
commit cee6867bd8
1 changed files with 4 additions and 1 deletions

View File

@ -1292,7 +1292,10 @@ static void* RunCoreThread(void *arg)
else
{
// If there is any time left in the loop, go ahead and pad it.
execControl->WaitUntilAbsoluteTime(startTime + frameTime);
if ( (execControl->GetCurrentAbsoluteTime() - startTime) < frameTime )
{
execControl->WaitUntilAbsoluteTime(startTime + frameTime);
}
}
const double currentExecutionSpeed = standardNDSFrameTime / (execControl->GetCurrentAbsoluteTime() - startTime);