Skip to content

Instantly share code, notes, and snippets.

@sasivarnan
Created April 29, 2016 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sasivarnan/ddd2856511b232059dfd3b8137e9b9e8 to your computer and use it in GitHub Desktop.
Save sasivarnan/ddd2856511b232059dfd3b8137e9b9e8 to your computer and use it in GitHub Desktop.
JavaScript - Single Threaded
(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