Created
August 4, 2014 19:03
-
-
Save raydog/cebdd6dd504664628f42 to your computer and use it in GitHub Desktop.
Super-simple profiler for async operations
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
function _test(cb) { | |
var file_line = new Error().stack.split(/\n/g)[2].trim(); | |
var start = Date.now(); | |
return function () { | |
console.log("%d :: %s", (Date.now() - start)/1000, file_line); | |
cb.apply(null, arguments); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment