Common/Timer: Use YieldProcessor on Windows.

This commit is contained in:
Jordan Woyak 2025-04-03 15:45:30 -05:00
parent 7dc27753e2
commit e0e53f3235
1 changed files with 6 additions and 0 deletions

View File

@ -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