Skip to content

Instantly share code, notes, and snippets.

@isRuslan
Created November 3, 2014 21:17
Show Gist options
  • Save isRuslan/02e9f0d00949f87710ad to your computer and use it in GitHub Desktop.
Save isRuslan/02e9f0d00949f87710ad to your computer and use it in GitHub Desktop.
Date timer
/**
* When it was happend?
* https://github.com/zhukov/webogram/blob/master/app/js/lib/utils.js#L8
* console.log(dT(), 'foo');
* [17.567] foo
* console.log(dT(), 'bar');
* [23.290] bar
*/
var _logTimer = (new Date()).getTime();
function dT () {
return '[' + (((new Date()).getTime() - _logTimer) / 1000).toFixed(3) + ']';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment