Is there a maximum delay limit for window.setInterval

巧了我就是萌 提交于 2019-12-04 23:36:41

According to the setTimeout documentation on the public wiki MDN there is indeed a maximum, though it doesn't seem "official" - the limitation is a signed 32 bit integer.

Maximum delay value

Browsers including Internet Explorer, Chrome, Safari, and Firefox store the delay as a 32-bit signed integer internally. This causes an integer overflow when using delays larger than 2147483647, resulting in the timeout being executed immediately.

The value of 2592000000 is indeed larger than 2147483647 thus causing the overflow.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!