Skip to content

Instantly share code, notes, and snippets.

@sorenlouv
Created December 15, 2015 00:18
Show Gist options
  • Save sorenlouv/b43e61c8b1423ad1a106 to your computer and use it in GitHub Desktop.
Save sorenlouv/b43e61c8b1423ad1a106 to your computer and use it in GitHub Desktop.
Measure time since start
var getTime = (function() {
var start = new Date().getTime();
return function () {
var end = new Date().getTime();
var time = end - start;
return time;
};
})();
console.log('time', getTime());
setTimeout(function(){
console.log('time', getTime());
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment