Created
June 18, 2015 11:48
-
-
Save metametadata/7ea557f8a2f1bdddd574 to your computer and use it in GitHub Desktop.
sleep in clojurescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn sleep [msec] | |
(let [deadline (+ msec (.getTime (js/Date.)))] | |
(while (> deadline (.getTime (js/Date.)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running this made my project freeze.
(js/setTimeout (fn []) timeout)
was what I ended using.