Skip to content

deflexable/set-large-timeout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

set-large-timeout

setTimeout greater than 0x7FFFFFFF (2147483647) milliseconds

Install

npm install set-large-timeout --save

or using yarn

yarn add set-large-timeout

example

import setLargeTimeout from "set-large-timeout";

const one_year = 2419200000;

const unsubscribe = setLargeTimeout(() => {
  console.log('finally called after 30 years 😮‍💨');
}, one_year * 30);

// clear timeout
unsubscribe();

details

The maximum delay that can be set with setTimeout is platform-dependent and is related to the limits of the 32-bit signed integer representation used for the delay parameter.

In a 32-bit signed integer system, the maximum value that can be represented is 2,147,483,647. Therefore, the maximum delay that can be set with setTimeout is approximately 2,147,483,647 milliseconds, which is equivalent to approximately 24.86 days.

About

setTimeout greater than 0x7FFFFFFF (2147483647)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published