cmux/node_modules/time-span
2026-01-29 17:36:26 -08:00
..
index.d.ts Update app and tooling 2026-01-29 17:36:26 -08:00
index.js Update app and tooling 2026-01-29 17:36:26 -08:00
license Update app and tooling 2026-01-29 17:36:26 -08:00
package.json Update app and tooling 2026-01-29 17:36:26 -08:00
readme.md Update app and tooling 2026-01-29 17:36:26 -08:00

time-span Build Status

Simplified high resolution timing

Install

$ npm install time-span

Usage

const timeSpan = require('time-span');

const end = timeSpan();

timeConsumingFn();

console.log(end());
//=> 1745.3186

console.log(end.rounded());
//=> 1745

console.log(end.seconds());
//=> 1.7453186

API

const end = timeSpan()

Returns a function, that when called, returns the time difference.

end()

Elapsed milliseconds.

end.rounded()

Elapsed milliseconds rounded.

end.seconds()

Elapsed seconds.

end.nanoseconds()

Elapsed nanoseconds.