Skip to content

Instantly share code, notes, and snippets.

@DronRathore
Created February 8, 2015 16:47
Show Gist options
  • Save DronRathore/63193f222965d09ef77f to your computer and use it in GitHub Desktop.
Save DronRathore/63193f222965d09ef77f to your computer and use it in GitHub Desktop.
Simple Timeout
var time = Date.now();
setTimeout(function(){console.log("I was fired after: ", Date.now()-time, "ms")}, 1);
/*
Output = I was fired after: 1 ms
*/
/*
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