X-Git-Url: https://git.ao2.it/experiments/fps-limit.git/blobdiff_plain/5d2f835b14ca786dc7c390aecb2e6c4b604c8be4..5b5e421a8ef9318f08455f0aa30d1278e1e8ca9f:/fps-limit.c 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); }