@cjser/max-timeout
v2.0.0-cjser.2
Published
The max amount of milliseconds you can pass to `setTimeout()`
Maintainers
Readme
max-timeout
The max amount of milliseconds you can pass to
setTimeout()
A value larger than the one returned from this module, 2147483647 (~25 days), is too big to fit into a signed 32-bit integer, which is how JS engines store it, and will cause overflow, resulting in the timeout being scheduled immediately.
Install
$ npm install max-timeoutUsage
import maxTimeout from 'max-timeout';
setTimeout(() => {}, maxTimeout);Related
- delay - Delay a promise a specified amount of time
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/max-timeout
