wait: Improve timer calculation, thanks derrek

This commit is contained in:
plutooo 2018-12-13 01:50:42 +01:00 committed by fincs
parent 1ad556cd22
commit fa19a5ada4

View File

@ -52,7 +52,7 @@ void _utimerRecalculate(UsermodeTimer* t, u64 old_tick)
if (t->next_tick == old_tick) if (t->next_tick == old_tick)
{ {
u64 interval = t->interval; u64 interval = t->interval;
u64 new_tick = ((armGetSystemTick() + interval - 1) / interval) * interval; u64 new_tick = old_tick + ((svcGetSystemTick() - old_tick + interval - 1)/interval)*interval;
t->next_tick = new_tick; t->next_tick = new_tick;
} }