msleep

1.0.4 • Public • Published

msleep

Small function that mimics the usleep C function, blocking the main thread. But instead of microseconds works with miliseconds, to feel more JS-like.

Useful for:

  • Debugging race conditions
  • Simulate blocked UI thread on the browser

Installation

npm install --save msleep

Usage

msleep(5000) // Will block the main thread for half a second

caiogondim.com  ·  GitHub @caiogondim  ·  Twitter @caio_gondim

Readme

Keywords

none

Package Sidebar

Install

npm i msleep

Weekly Downloads

13

Version

1.0.4

License

MIT

Unpacked Size

56.6 kB

Total Files

9

Last publish

Collaborators

  • caiogondim