node-hrstopwatch

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i node-hrstopwatch

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • alansav