- Version: 6.x 7.x 8.x master:
- Platform: n/a:
- Module: timers:
When there are at least two timer set by setInterval, whose callback execution time are longer than interval, the eventloop will be blocked, meanwhile the 4.x is not. You may take the following code to have a test.
@Fishrock123 It seems the timers module refactoring brings this.
consthttp=require('http');constsleep=function(ms){constst=newDate().getTime();while(newDate().getTime()<st+ms);};constt1=setInterval(function(){sleep(100);},50)constt2=setInterval(function(){sleep(60);},50);http.createServer(function(req,res){res.end('hello '+newDate());}).listen(8888);
When there are at least two timer set by setInterval, whose callback execution time are longer than interval, the eventloop will be blocked, meanwhile the
4.xis not. You may take the following code to have a test.@Fishrock123 It seems the
timersmodule refactoring brings this.