@kofile/timer

1.0.1 • Public • Published

Timer

Build Status Coverage Status Commitizen friendly semantic-release

A small timer utility, for benchmarking runtimes in Node programs.

Example:

const Timer = require('@kofile/timer')

const timer = new Timer('some key')

timer.on('end', (message, [seconds, nanoseconds]) => {
  console.info('message is:', message)
  //=> Duration for "some key": 5s 0.000552ms
  console.info(`seconds: ${seconds}s, nanoseconds: ${nanoseconds}ns`)
})

timer.start()

setTimeout(() => { timer.end() }, 5000)

Supported Platforms

Node 7+

Testing

Run tests with npm test

Authors

Readme

Keywords

none

Package Sidebar

Install

npm i @kofile/timer

Weekly Downloads

13

Version

1.0.1

License

MIT

Last publish

Collaborators

  • hd-kofile
  • oliverhoff
  • fernandofgovos
  • bwgovos
  • juandagovos
  • matt_huntsberry
  • afine_govos
  • bthomas_govos
  • chrisburch-govos
  • rarzate
  • narekdaghlaryan
  • daniltarasov
  • kofilesystems
  • neezer
  • scottkof
  • jbalfantz
  • ngraves
  • arturhovhannisyan1994volo
  • rachel-ftw
  • warrenyoungkofile