Created
February 9, 2012 10:50
-
-
Save micho/1779237 to your computer and use it in GitHub Desktop.
debug times for js
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
/** | |
* 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