npm.io
1.0.1 • Published 6 years ago

set-accurate-timeout

Licence
MIT
Version
1.0.1
Deps
1
Size
3 kB
Vulns
0
Weekly
0

Sets an accurate timeout that respects date, and the result can't be less than the specified amount of milliseconds. Implemented by recursive execution of native setTimeout. The error is about 10ms.

Install package

npm install set-accurate-timeout
Install dependencies and build library
  • Install dependencies

    npm install

  • Run tests

    npm run test

Usage example
const setAccurateTimeout=require('set-accurate-timeout')
setAccurateTimeout(() => {
  console.log('So, 5s have passed.')
}, 5000)

Keywords