Add sleep() and usleep() to nodejs
JavaScript C++ Python
Switch branches/tags
Latest commit e69ca7e Aug 16, 2017 @erikdubbelboer Fix early signal bug
Fixes #78
Permalink
Failed to load latest commit information.
.gitignore 2.0.0 Feb 7, 2015
LICENSE.txt Fix license Jun 3, 2015
README.md msleep (#64) Jan 4, 2017
binding.gyp 2.0.0 Feb 7, 2015
index.js msleep (#64) Jan 4, 2017
package.json Bump version to 5.1.1 Apr 8, 2017
sleep.cc Fix early signal bug Aug 16, 2017
test.js Fix early signal bug Aug 16, 2017

README.md

sleep

Add sleep(), msleep() and usleep() to Node.js, via a C++ binding.

This is mainly useful for debugging.

These calls will block execution of all JavaScript by halting Node.js' event loop!

Usage

var sleep = require('sleep');
  • sleep.sleep(n): sleep for n seconds
  • sleep.msleep(n): sleep for n miliseconds
  • sleep.usleep(n): sleep for n microseconds (1 second is 1000000 microseconds)