A high resolution timer for Node.js with precision in milliseconds.
npm install dannynemer/hrtimer
var hrtimer = require('hrtimer')
// Start timer
hrtimer.start('my test')
// ...stuff...
hrtimer.end('my test')
// => Prints "my test: 13.264 ms"
// ...more stuff...
hrtimer.end('my test')
// => Prints "my test: 31.183 ms"
Starts a high-resolution timer (with precision in microseconds) identified by label
. Use hrtimer.end(label)
to print the timer's current value.
label
(string): The timer identifier.
Prints the current high-resolution value of a timer initiated with hrtimer.start(label)
.
label
(string): The timer identifier.