mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-06 11:22:15 +02:00
wait: Improve timer calculation, thanks derrek
This commit is contained in:
parent
a6bf41a17e
commit
9121c6f22f
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user