2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

core_timing: Make use of MicroSleep for x64 CPUs

For CPUs that support tpause, this should result in significant CPU power savings over thread yield in this spin wait.
This commit is contained in:
Morph 2023-03-21 21:30:02 -04:00
parent 27c33ab73f
commit e1bce50d8b

View file

@ -10,6 +10,10 @@
#include "common/windows/timer_resolution.h"
#endif
#ifdef ARCHITECTURE_x86_64
#include "common/x64/cpu_wait.h"
#endif
#include "common/microprofile.h"
#include "core/core_timing.h"
#include "core/core_timing_util.h"
@ -269,7 +273,11 @@ void CoreTiming::ThreadLoop() {
if (wait_time >= timer_resolution_ns) {
Common::Windows::SleepForOneTick();
} else {
#ifdef ARCHITECTURE_x86_64
Common::X64::MicroSleep();
#else
std::this_thread::yield();
#endif
}
}