A high resolution stopwatch using the hrtime function of the Node.JS process object which returns duration in nanoseconds.
npm install node-hrstopwatch===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.