Skip to content

Instantly share code, notes, and snippets.

@tmkasun
Created May 5, 2021 06:19
Show Gist options
  • Save tmkasun/e19d9c4de8f856a0ef42dceb7d5a9930 to your computer and use it in GitHub Desktop.
Save tmkasun/e19d9c4de8f856a0ef42dceb7d5a9930 to your computer and use it in GitHub Desktop.
Demo - Effect of blocking the main event loop in JavaScript
  • Open the Link
  • Open the Developer console
  • And type
setInterval(() => {var a = Date.now(); while(Date.now() - a < 1000);},3000)
  • Open the performace monitor in the browser
  • And you will see the below CPU usage pattern image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment