Package Exports
- ns-elapsed
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ns-elapsed) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ns-elapsed
Simple, high resolution stopwatch for nodeJS. Ideal for benchmark times.
examples
Asynchronous example
var Elapsed() = require('ns-elapsed')
var e = new Elapsed()
e.set() // This is superfluous because 'set()' is automatically called when 'e' was constructed.
setTimeout(function() { // Asynchronous code here
console.log( e.get() )
}, 1000)Synchronous example:
var elapsed = require('ns-elapsed')()
// Synchronous code here
console.log( e.get() )api
var Elapsed = require('ns-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