summaryrefslogtreecommitdiffstats
path: root/lib/utils/timing.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils/timing.js')
-rw-r--r--lib/utils/timing.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/utils/timing.js b/lib/utils/timing.js
index 9903af2..e6b0323 100644
--- a/lib/utils/timing.js
+++ b/lib/utils/timing.js
@@ -75,11 +75,12 @@ function dump(logger) {
return timer.total;
})
.forEach(function(timer) {
- logger.debug.ln('Timer "' + timer.type + '" (' + timer.count + ' times) :');
- logger.debug.ln(prefix + 'Total: ' + time(timer.total));
- logger.debug.ln(prefix + 'Average: ' + time(timer.total / timer.count));
- logger.debug.ln(prefix + 'Min: ' + time(timer.min));
- logger.debug.ln(prefix + 'Max: ' + time(timer.max));
+ var percent = (timer.total * 100) / totalDuration;
+
+
+ logger.debug.ln((percent.toFixed(1)) + '% of time spent in "' + timer.type + '" (' + timer.count + ' times) :');
+ logger.debug.ln(prefix + 'Total: ' + time(timer.total)+ ' | Average: ' + time(timer.total / timer.count));
+ logger.debug.ln(prefix + 'Min: ' + time(timer.min) + ' | Max: ' + time(timer.max));
logger.debug.ln('---------------------------');
});