diff options
Diffstat (limited to '')
-rw-r--r-- | timer.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -180,7 +180,6 @@ int timer_process(struct timespec *delay) if (Timers[i].one_shot) { Timers[i].active = 0; } else { - Timers[i].when = now; timer_inc(&Timers[i].when, Timers[i].interval); } } @@ -203,6 +202,9 @@ int timer_process(struct timespec *delay) return -1; } + /* update the current moment to compensate for processing delay */ + gettimeofday(&now, NULL); + /* delay until next timer event */ struct timeval diff; timersub(&Timers[min].when, &now, &diff); |