Skip to content

Instantly share code, notes, and snippets.

@julesbou
Created March 11, 2016 15:56
Show Gist options
  • Save julesbou/3150977a8a21c431ea99 to your computer and use it in GitHub Desktop.
Save julesbou/3150977a8a21c431ea99 to your computer and use it in GitHub Desktop.
_.mixin({
profile: function(fn) {
return function(profileId) {
// start profiler
console.profile(profileId);
// call our real function
fn.apply(this, arguments);
// stop profiler
console.profileEnd(profileId);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment