Created
July 13, 2017 23:07
-
-
Save patrickhulce/69d8bed1807e762218994b121d06fea6 to your computer and use it in GitHub Desktop.
Infinite TTCI
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
<html> | |
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1"> | |
<body> | |
Just try and figure out my TTCI (hint: it should be NEVER)<br> | |
This is a test to ensure we properly handle PerformanceObserver lifecycle, see | |
<a href="https://crbug.com/742530">https://crbug.com/742530</a> | |
<script> | |
/** | |
* Stalls the main thread for timeInMs | |
*/ | |
function stall(timeInMs) { | |
const start = performance.now(); | |
while (performance.now() - start < timeInMs) { | |
for (let i = 0; i < 1000000; i++) ; | |
} | |
} | |
function keepStalling() { | |
stall(50); | |
setTimeout(keepStalling, 4000 + Math.random() * 700); | |
} | |
keepStalling(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment