From 29ba7770049ae96e0847489de63500c0cf4716a6 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Wed, 18 Dec 2013 00:11:57 +0100 Subject: [PATCH] Make the example code clearer --- fps-limit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fps-limit.c b/fps-limit.c index bccb8a5..2c24807 100644 --- a/fps-limit.c +++ b/fps-limit.c @@ -28,11 +28,14 @@ int main(void) fps_limit_init(&stats, FPS); while (1) { - fps_limit_dbg("Doing some work, max: %d", NSEC_PER_SEC / FPS); + fps_limit_dbg("Doing some work, minimum: %dns", NSEC_PER_SEC / FPS); + + /* simulate a shorter workload */ tmp.tv_sec = 0; tmp.tv_nsec = (NSEC_PER_SEC / FPS) * 2 / 3; nanosleep(&tmp, NULL); + /* and wait for the delay imposed by the limit */ fps_limit_sleep(&stats); } -- 2.1.4