timer-lite

1.0.4 • Public • Published

A Timer class to help with debugging long functions

Usage

const TimerLite = require( 'timer-lite' );

let debugTimer = new TimerLite();

debugTimer.startTime // outputs, in epoch time, when the timer started

debugTimer.events;
//=> []

debugTimer.addEvent( 'title' );
debugTimer.addEvent( 'another title', { 'whatever' : 'you would like' } );
debugTimer.events;
//=> [ { 'title' : 'title' }, { 'title' : 'another title', 'optionalData' : { 'whatever' : 'you would like' } } ]

debugTimer.showEvents() // Will output the events, and the time between the event and the previous event.

License

MIT © Matthew Young

Readme

Keywords

none

Package Sidebar

Install

npm i timer-lite

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

6.95 kB

Total Files

8

Last publish

Collaborators

  • mashu.daishi