Skip to content

Instantly share code, notes, and snippets.

@jjb jjb/
Created Jan 18, 2018

What would you like to do?
Sleep in coffeescript
sleep = (ms)->
date = new Date()
break if (new Date())-date > ms
# from
# as foretold in a million passionate comments by programmers 'round the world,
# using this in business logic in javascript is a bad idea. but it sometimes comes in
# handy when trying to experiment with something in dev (like if you want to simulate
# a timeout)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.