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())
})();