Last active
August 13, 2018 17:11
-
-
Save chaiwa-berian/c5ae70f332c9cd7e7892d54bfdb44429 to your computer and use it in GitHub Desktop.
Nodejs Blocking Code Example
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('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