Created
March 11, 2016 15:56
-
-
Save julesbou/3150977a8a21c431ea99 to your computer and use it in GitHub Desktop.
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
_.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