Skip to content

Instantly share code, notes, and snippets.

@songjiayang
Created September 16, 2014 02:52
Show Gist options
  • Save songjiayang/0a7f815bf1e0af8ffa72 to your computer and use it in GitHub Desktop.
Save songjiayang/0a7f815bf1e0af8ffa72 to your computer and use it in GitHub Desktop.
javascript delay function
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