Skip to content

Instantly share code, notes, and snippets.

@raydog
Created August 4, 2014 19:03
Show Gist options
  • Save raydog/cebdd6dd504664628f42 to your computer and use it in GitHub Desktop.
Save raydog/cebdd6dd504664628f42 to your computer and use it in GitHub Desktop.
Super-simple profiler for async operations
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