wait: Improve timer calculation, thanks derrek

This commit is contained in:
plutooo 2018-12-13 01:50:42 +01:00
parent a6bf41a17e
commit 9121c6f22f

View File

@ -52,7 +52,7 @@ void _utimerRecalculate(UsermodeTimer* t, u64 old_tick)
if (t->next_tick == old_tick)
{
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;
}