Created
April 29, 2016 11:50
-
-
Save sasivarnan/ddd2856511b232059dfd3b8137e9b9e8 to your computer and use it in GitHub Desktop.
JavaScript - Single Threaded
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
(function(){ | |
console.log(new Date().getTime()); | |
setTimeout(function(){ | |
console.log('set'); | |
console.log(new Date().getTime()); | |
},0); | |
for(var i = 0; i< 100; i++){ | |
//do some heavy synchronous operations | |
} | |
console.log(new Date().getTime()) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment