Created
February 8, 2015 16:47
-
-
Save DronRathore/63193f222965d09ef77f to your computer and use it in GitHub Desktop.
Simple Timeout
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
var time = Date.now(); | |
setTimeout(function(){console.log("I was fired after: ", Date.now()-time, "ms")}, 1); | |
/* | |
Output = I was fired after: 1 ms | |
*/ |
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
/* | |
Lets peform little task | |
*/ | |
var time = Date.now(); | |
setTimeout(function(){console.log("I was fired after: ", Date.now()-time, "ms")}, 1); | |
console.log(Array(10000000)) | |
/* | |
Output: | |
Will vary I got a range from 100ms~200ms | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment