ns-elapsed
Simple, high resolution stopwatch for nodeJS. Ideal for benchmark times.
examples
Asynchronous example
var = var e = e // This is superfluous because 'set()' is automatically called when 'e' was constructed.
Synchronous example:
var elapsed = // Synchronous code hereconsole
api
var Elapsed =
var e = new Elapsed()
e.set()
Does not return anything. Automatically called upon construction.
var sec = e.get()
Returns the number of seconds elapsed. E.g. 13.947172826
, which is almost 14 seconds.
install
Install with NPM
npm install ns-elapsed