node-hrstopwatch
v1.0.1
Published
A high resolution stopwatch using the hrtime function of the Node.JS process object which returns duration in nanoseconds.
Downloads
6
Maintainers
Readme
node-stopwatch
A high resolution stopwatch using the hrtime function of the Node.JS process object which returns duration in nanoseconds. https://nodejs.org/api/process.html#process_process_hrtime
===Usage===
To use the stop watch in your code:
var Stopwatch = require('node-stopwatch');
var stopwatch = new Stopwatch(); stopwatch.start();
//Do some task
stopwatch.stop();
var duration = stopwatch.getDuration(); console.log(duration);
The console will output the duration in nanoseconds.