@f/elapsed-time

Maintain a running counter of time elapsed from a certain point

Stats

StarsIssuesVersionUpdatedCreatedSize
@f/elapsed-time
001.0.06 years ago6 years agoMinified + gzip package size for @f/elapsed-time in KB

Readme

elapsed-time

Build status Git tag NPM version Code style

Maintain a running counter of time elapsed from a certain point

Installation

$ npm install @f/elapsed-time

Usage

var elapsed = require('@f/elapsed-time')

var time = elapsed()

time() // ~0
setTimeout(function () {
  time() // ~20
  setTimeout(function () {
    time() // ~50
  }, 30)
}, 20)

API

elapsedTime(start)

  • start - Optional starting point in milliseconds. If not passed, defaults to the current time.

Returns: A function that, when called, returns the elapsed time since start.

License

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.