From c2f9c9615e28fb009f1e0537704645526549b15f Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 9 Dec 2018 14:45:58 -0500 Subject: game-loop: Sleep thread a bit to avoid 100% CPU usage. --- chickadee.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'chickadee.scm') diff --git a/chickadee.scm b/chickadee.scm index f6894b0..386e99f 100644 --- a/chickadee.scm +++ b/chickadee.scm @@ -83,7 +83,9 @@ ;; that was spent handling the error. (if (with-error-handling error (update timestep)) (loop (time) 0) - (update-loop (- buffer timestep))) + (begin + (usleep 1) + (update-loop (- buffer timestep)))) (begin ;; We render upon every iteration of the loop, and ;; thus rendering is decoupled from updating. -- cgit v1.2.3