diff options
author | David Thompson <dthompson2@worcester.edu> | 2018-12-09 14:45:58 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2018-12-09 14:45:58 -0500 |
commit | c2f9c9615e28fb009f1e0537704645526549b15f (patch) | |
tree | 67ecf1bdcfaf9911a09f668ace98ed20b52959ed /chickadee.scm | |
parent | bca534837b1ec406f1152f93b21c7206606d205c (diff) |
game-loop: Sleep thread a bit to avoid 100% CPU usage.
Diffstat (limited to 'chickadee.scm')
-rw-r--r-- | chickadee.scm | 4 |
1 files changed, 3 insertions, 1 deletions
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. |