Skip to content

Instantly share code, notes, and snippets.

@creationix
Created March 8, 2012 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creationix/a81b1423b715563a590e to your computer and use it in GitHub Desktop.
Save creationix/a81b1423b715563a590e to your computer and use it in GitHub Desktop.
setTimeout(callback, interval) {
scope uv, print
fn = callback
timer = uv.newTimer()
uv.timerStart(timer, interval, 0)
timer.onTimer = () {
scope uv, timer, fn
uv.close(timer)
fn()
}
return timer
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment