Created
September 10, 2014 19:48
-
-
Save infn8/130b715f55392d042c75 to your computer and use it in GitHub Desktop.
Clear All JS Timers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tempID = window.setTimeout(function() {}, 0); | |
while (tempID--) { | |
window.clearTimeout(tempID); // will do nothing if no timeout with tempID is present | |
} | |
tempID = window.setInterval(function() {}, 0); | |
while (tempID--) { | |
window.clearInterval(tempID); // will do nothing if no interval with tempID is present | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment