diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/timer_loop.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/timer_loop.c b/tests/timer_loop.c index a9ce283..a90f7c0 100644 --- a/tests/timer_loop.c +++ b/tests/timer_loop.c @@ -19,8 +19,8 @@ static void timer_callback(void *userdata, struct nn_timer *timer) s64 adj = iter * DELAY - (s64)diff; al_printf("[%2u (%llu)] %fs(%s%f)\n", iter, now, diff / 1000000.0, adj >= 0 ? "+" : "", adj / 1000000.0); nn_timer_set_repeat(timer, NNWT_TS_FROM_USEC(MAX(DELAY + adj, (s64)1))); - if (++iter == REPEAT) nn_timer_stop(timer); - else nn_timer_again(timer); + if (iter++ == 0) nn_timer_again(timer); + else if (iter == REPEAT) nn_timer_stop(timer); } s32 main(void) |