求助,关于nodejs中setinterval方法millisec最大值的问题
发布于 2 年前 作者 panhb 1673 次浏览 来自 问答

代码如下

var test = function() {       
	console.log(new Date());	       
};        
var delay = 25*24*60*60*1000;         
setInterval(test,delay);        

此代码并不会以25天为周期执行,而是会不停的执行,请问setinterval方法中millisec参数有最大值的限制吗?
nodejs版本是v4.2.1

1 回复

额,刚看了API

To follow browser behavior, when using delays larger than 2147483647 milliseconds (approximately 25 days) or less than 1, the timeout is executed immediately, as if the delay was set to 1.
回到顶部