Created
May 7, 2020 13:00
-
-
Save pprathameshmore/d6661d3a1a7c1e537e82e7a645611f67 to your computer and use it in GitHub Desktop.
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
console.log('Starting the main thread'); | |
console.log('Getting started'); | |
wasteTime(); | |
console.log('In the middle'); | |
wasteTime(); | |
console.log('All done'); | |
console.log('Still in main thread'); | |
function wasteTime() { | |
const end = Date.now() + 3000; | |
while (Date.now() < end) { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment