Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

set-accurate-timeout

notacircle46MIT1.0.1TypeScript support: definitely-typed

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.

timeout, accurate, guaranteed, setTimeout, precise, setInterval

readme

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)