Skip to content

Instantly share code, notes, and snippets.

@chaiwa-berian
Last active August 13, 2018 17:11
Show Gist options
  • Save chaiwa-berian/c5ae70f332c9cd7e7892d54bfdb44429 to your computer and use it in GitHub Desktop.
Save chaiwa-berian/c5ae70f332c9cd7e7892d54bfdb44429 to your computer and use it in GitHub Desktop.
Nodejs Blocking Code Example
console.log('Step: 1');
var startTime = Date.now();
console.log('Start time: ', startTime);
for(let i=1;i<10000000000;i++){
//Do Nothing
}
var endTime = Date.now();
console.log('Step: 2 started!');
console.log('End Time: ', endTime);
console.log('Time Taken: ', endTime-startTime);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment