precisetimeout

1.0.1 • Public • Published

PreciseTimeout

npm npm Build Status GitHub license

Set highly-accurate timeouts for your projects

What is this package for?

The built-in setTimeout is certainly not accurate after long times (over 10 minutes), and handling the imprecision is quite hard without recursion. On the other side, it is relatively easy to correct that error when it's a promisified timeout, however, util.promisify(setTimeout) effectively returns a method that, when called, it can't be stopped (unlike the normal timeout, which can be stopped with clearTimeout) but is easier to run.

This package allows developers to set their highly-accurate promisified timeouts that can be cancelled anytime. This package can also be used easily in TypeScript as typings are included aswell.

Note: Minimum version required is node.js 7.6.0 or newer without the flag due to the usage of async/await, however, I highly suggest to use at least node.js 8.0.0.

Downloading

Stable version:

npm i precisetimeout

Indev version:

In a command prompt in your projects folder (wherever that may be) run the following:

git clone https://github.com/kyranet/PreciseTimeout.git

Readme

Keywords

Package Sidebar

Install

npm i precisetimeout

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • kyranet