Common/Timer: Use YieldProcessor on Windows.
This commit is contained in:
parent
7dc27753e2
commit
e0e53f3235
|
@ -185,7 +185,13 @@ void PrecisionTimer::SleepUntil(Clock::time_point target)
|
|||
|
||||
// Spin for the remaining time.
|
||||
while (Clock::now() < target)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
YieldProcessor();
|
||||
#else
|
||||
std::this_thread::yield();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
} // Namespace Common
|
||||
|
|
Loading…
Reference in New Issue