Add timeline recording helper to debug

This commit is contained in:
Joe Fiorini
2015-06-02 12:09:22 -04:00
parent 86a16d27ea
commit a3f5d9a9a5

View File

@@ -43,3 +43,16 @@ export function __deferLoadIfEnabled() {
}
}
/* jshint ignore:start */
export function time(fn, label) {
return function() {
console.timeline(label);
return _.tap(fn.apply(this, arguments), function() {
console.timelineEnd(label);
});
};
}
/* jshint ignore:end */