node package manager
Orgs are free. Discover, share, and reuse code in your team. Create a free org ยป

sleep

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)