summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2020-04-02 13:27:08 -0400
committerGravatar Fernando Sahmkow2020-06-27 11:36:07 -0400
commitbfb5244cf8c600e6444d8590c8850ec31779bc6c (patch)
tree6fec4aae569ef4ced64d1a1e52058975d2b9ca9b /src
parentSingleCore: Correct ticks reset to be on preemption. (diff)
downloadyuzu-bfb5244cf8c600e6444d8590c8850ec31779bc6c.tar.gz
yuzu-bfb5244cf8c600e6444d8590c8850ec31779bc6c.tar.xz
yuzu-bfb5244cf8c600e6444d8590c8850ec31779bc6c.zip
CoreTiming/CycleTimer: Correct Idling.
Diffstat (limited to 'src')
-rw-r--r--src/core/core_timing.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index 12e9e60a4..b02119494 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -136,8 +136,11 @@ void CoreTiming::AddTicks(u64 ticks) {
136 136
137void CoreTiming::Idle() { 137void CoreTiming::Idle() {
138 if (!event_queue.empty()) { 138 if (!event_queue.empty()) {
139 u64 next_event_time = event_queue.front().time; 139 const u64 next_event_time = event_queue.front().time;
140 ticks = nsToCycles(std::chrono::nanoseconds(next_event_time)) + 10U; 140 const u64 next_ticks = nsToCycles(std::chrono::nanoseconds(next_event_time)) + 10U;
141 if (next_ticks > ticks) {
142 ticks = next_ticks;
143 }
141 return; 144 return;
142 } 145 }
143 ticks += 1000U; 146 ticks += 1000U;