Skip to content
This repository has been archived by the owner on Jun 17, 2020. It is now read-only.

Commit

Permalink
Use Thread.yield instead of Thread.sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
harto committed Jan 20, 2013
1 parent bfba553 commit df2f430
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions swing/src/enoki/engine_impl.clj
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
(ns enoki.engine-impl)

(defn loop-forever
"A naïve game loop implementation that sleeps for 1 millisecond between
calls to `tick'."
"A naïve game loop implementation that calls `tick' as often as possible."
[tick env]
(loop [env env]
(Thread/sleep 1)
(Thread/yield)
(recur (tick env))))

0 comments on commit df2f430

Please sign in to comment.