@f/elapsed-time

    1.0.0 • Public • Published

    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

    Keywords

    none

    Install

    npm i @f/elapsed-time

    DownloadsWeekly Downloads

    60,321

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • f