summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-10-30 12:32:33 -0400
committerAndrew Opalach <andrew@akon.city> 2025-10-30 12:32:33 -0400
commit36295da7869a8254b56afd2b73a239b4d9b81876 (patch)
tree91ccd1f40ba57206aee4b41c77a07df076645d24 /tests
parente84da83774a981be3a325c64d887a393a83aac7b (diff)
downloadlibnaunet-36295da7869a8254b56afd2b73a239b4d9b81876.tar.gz
libnaunet-36295da7869a8254b56afd2b73a239b4d9b81876.tar.bz2
libnaunet-36295da7869a8254b56afd2b73a239b4d9b81876.zip
Little fixes and logging tweaks
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'tests')
-rw-r--r--tests/timer_loop.c4
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)