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
@niicM yes, this snippet shouldn't be used in 99,9% of cases. It just hangs the CPU :)