Created
November 1, 2017 19:47
-
-
Save andrewchilds/b2b47a0eb150da275c10d846540b36b7 to your computer and use it in GitHub Desktop.
How long does it take to stop JS execution during a location redirect?
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
for (var i = 0; i < 1000; i++) { | |
logAndRedirect(i); | |
} | |
window.location.href = window.location.href; | |
function logAndRedirect(i) { | |
setTimeout(function () { | |
window.console.log(i); | |
}, i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment