Skip to content

Instantly share code, notes, and snippets.

@hotakasaito
Last active August 29, 2015 14:23
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 hotakasaito/a3cac9f57c211573136f to your computer and use it in GitHub Desktop.
Save hotakasaito/a3cac9f57c211573136f to your computer and use it in GitHub Desktop.
module.exports = (robot) ->
sleep = (ms) ->
start = new Date().getTime()
continue while new Date().getTime() - start < ms
robot.on 'my:sleep', (ms) ->
sleep ms
robot.emit 'my:sleep', 1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment