set-accurate-timeout
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/set-accurate-timeout package

1.0.1 • Public • Published

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)

Dependents (0)

Package Sidebar

Install

npm i set-accurate-timeout

Weekly Downloads

12

Version

1.0.1

License

MIT

Unpacked Size

2.68 kB

Total Files

5

Last publish

Collaborators

  • notacircle