max-timeout

The max amount of milliseconds you can pass to `setTimeout()`

MIT 2 个版本
安装
npm install max-timeout
yarn add max-timeout
pnpm add max-timeout
bun add max-timeout
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-timeout

Usage

import maxTimeout from 'max-timeout';

setTimeout(() => {}, maxTimeout);
  • delay - Delay a promise a specified amount of time
版本列表
2.0.0 2021-04-07
1.0.0 2015-11-15