node-simple-timer
A bare-bones timer for JavaScript - implemented in TypeScript.
Installation:
$ npm install node-simple-timer
or
$ yarn add node-simple-timer
Usage:
import {Timer} from 'node-simple-timer';
const timer = new Timer();
timer.start();
let ms = timer.milliseconds();
ms = timer.milliseconds();
timer.end();
ms = timer.milliseconds();
console.log('Total seconds: ', timer.seconds();
Start a Timer at construction time.
const timer = new Timer(true);
Chaining methods:
const timer = new Timer();
timer.start();
const ns = timer.end().nanoseconds();