From a3f5d9a9a5159f6cdae202745f9b923fc9881a72 Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Tue, 2 Jun 2015 12:09:22 -0400 Subject: [PATCH] Add timeline recording helper to debug --- awx/ui/static/js/debug.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/awx/ui/static/js/debug.js b/awx/ui/static/js/debug.js index 81c5624587..29cd88a8fc 100644 --- a/awx/ui/static/js/debug.js +++ b/awx/ui/static/js/debug.js @@ -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 */ +