mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-23 17:00:57 +01:00
CoreTiming/CycleTimer: Correct Idling.
This commit is contained in:
parent
bece52cd81
commit
bfb5244cf8
1 changed files with 5 additions and 2 deletions
|
@ -136,8 +136,11 @@ void CoreTiming::AddTicks(u64 ticks) {
|
||||||
|
|
||||||
void CoreTiming::Idle() {
|
void CoreTiming::Idle() {
|
||||||
if (!event_queue.empty()) {
|
if (!event_queue.empty()) {
|
||||||
u64 next_event_time = event_queue.front().time;
|
const u64 next_event_time = event_queue.front().time;
|
||||||
ticks = nsToCycles(std::chrono::nanoseconds(next_event_time)) + 10U;
|
const u64 next_ticks = nsToCycles(std::chrono::nanoseconds(next_event_time)) + 10U;
|
||||||
|
if (next_ticks > ticks) {
|
||||||
|
ticks = next_ticks;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ticks += 1000U;
|
ticks += 1000U;
|
||||||
|
|
Loading…
Reference in a new issue