Created
September 16, 2014 02:52
-
-
Save songjiayang/0a7f815bf1e0af8ffa72 to your computer and use it in GitHub Desktop.
javascript delay function
This file contains hidden or 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
delay: ( -> | |
timer = 0 | |
(callback, ms) -> | |
clearTimeout timer | |
timer = setTimeout(callback, ms) | |
)() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment