-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.timersIssues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.
Description
- Version: Tested on 6.0.0
- Platform: Tested on Windows & MacOS
- Subsystem: Timer
This program cost 20 seconds, but 10.5 seconds was expected:
var handle = setTimeout(function(){
clearTimeout(handle);
handle = setTimeout( function() {
}, 10000 );
setTimeout( function() {
clearTimeout( handle );
}, 500 );
}, 10000);But all below codes work as expected:
var handle = setTimeout(function(){
clearTimeout(handle);
handle = setTimeout( function() {
}, 10000 );
setTimeout( function() {
clearTimeout( handle );
}, 500 );
}, 2000); // <-- different delay var handle = setTimeout(function(){
//clearTimeout(handle); <-- comment this line.
handle = setTimeout( function() {
}, 10000 );
setTimeout( function() {
clearTimeout( handle );
}, 500 );
}, 10000);Does clearTimeout with a invalid handle causes this problem?
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.timersIssues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.