Skip to content

Instantly share code, notes, and snippets.

@micho
Created February 9, 2012 10:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micho/1779237 to your computer and use it in GitHub Desktop.
Save micho/1779237 to your computer and use it in GitHub Desktop.
debug times for js
/**
* Create a debugger with the given `name`.
*
* @param {String} name
* @return {Type}
* @api public
*/
function debug(name) {
var now = Date.now();
return function (wat) {
console.log('[' + name + ']', wat, ((Date.now() - now) / 1000).toFixed(4));
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment