time things. outputs to visionmedia/debug.
Install with component(1):
$ component install matthewmueller/debug-timer
Install with npm:
$ npm install debug-timer
var timer = require('debug-timer')('timer');
timer('js');
timer('css');
setTimeout(function() {
timer.end('js')
}, 1000);
setTimeout(function() {
timer.end('css')
}, 2000);
Assign timer to a namespace. In the code this means: require('debug')(namespace)
.
Start a timer with the given key
.
End the timer with the given key
.
Assign a custom template. The first %s
is the key, second %s
is the elapsed time. Defaults to:
timer.template = %s: %s;
MIT