mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-14 00:59:54 -05:00
core_timing: Remove GetCurrentTimerResolution in CoreTiming loop
Other programs may change this value, but if thousands of syscalls in this loop is undesirable, then we can just set this once.
This commit is contained in:
@ -253,9 +253,6 @@ void CoreTiming::ThreadLoop() {
|
||||
auto wait_time = *next_time - GetGlobalTimeNs().count();
|
||||
if (wait_time > 0) {
|
||||
#ifdef _WIN32
|
||||
const auto timer_resolution_ns =
|
||||
Common::Windows::GetCurrentTimerResolution().count();
|
||||
|
||||
while (!paused && !event.IsSet() && wait_time > 0) {
|
||||
wait_time = *next_time - GetGlobalTimeNs().count();
|
||||
|
||||
@ -316,4 +313,10 @@ std::chrono::microseconds CoreTiming::GetGlobalTimeUs() const {
|
||||
return std::chrono::microseconds{Common::WallClock::CPUTickToUS(cpu_ticks)};
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
void CoreTiming::SetTimerResolutionNs(std::chrono::nanoseconds ns) {
|
||||
timer_resolution_ns = ns.count();
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace Core::Timing
|
||||
|
Reference in New Issue
Block a user