$ gnpm install time-span
Simplified high resolution timing
Uses process.hrtime
in Node.js and performance.now
in browsers (accurate to 5 microseconds).
$ npm install time-span
import timeSpan from 'time-span';
const end = timeSpan();
timeConsumingFn();
console.log(end());
//=> 1745.3186
console.log(end.rounded());
//=> 1745
console.log(end.seconds());
//=> 1.7453186
const end = timeSpan()
Returns a function, that when called, returns the time difference.
Elapsed milliseconds.
Elapsed milliseconds rounded.
Elapsed seconds.
Elapsed nanoseconds.
Copyright 2013 - present © cnpmjs.org | Home |