Call timeBeginPeriod only once on startup (#6273)

Use SetProcessInformation to make the OS better handle our threads on big/small cores
This commit is contained in:
Cacodemon345
2025-10-04 02:03:11 +06:00
committed by GitHub
parent da018531e0
commit 37edcce1fa
3 changed files with 77 additions and 14 deletions

View File

@@ -65,11 +65,7 @@ void
plat_delay_ms(uint32_t count)
{
#ifdef Q_OS_WINDOWS
// On Win32 the accuracy of Sleep() depends on the timer resolution, which can be set by calling timeBeginPeriod
// https://learn.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timebeginperiod
timeBeginPeriod(1);
Sleep(count);
timeEndPeriod(1);
#else
QThread::msleep(count);
#endif