JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 31
  • Score
    100M100P100Q52013F

fluent timer with laps, microtime + parsing, multiple timers

Package Exports

  • fliptime

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fliptime) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

⛓⏲ fliptime

[![NPM version][fliptime-image]][fliptime-url] [![MIT License][license-image]][license-url] [![fliphub][gitter-badge]][gitter-url] [fliptime-image]: https://img.shields.io/npm/v/fliptime.svg [fliptime-url]: https://npmjs.org/package/fliptime [license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat [license-url]: https://spdx.org/licenses/MIT [gitter-badge]: https://img.shields.io/gitter/room/fliphub/pink.svg [gitter-url]: https://gitter.im/fliphub/Lobby

fluent timer with laps, microtime + parsing, multiple timers

usage

yarn add fliptime
npm i fliptime --save
const timer = require('fliptime')

uses microtime formatted with microseconds

simple

timer.start('canada')
setTimeout(() => timer.end('canada').log('canada'), 500)

laps

timer.start('canada')
const lapper = setInterval(() => {
  timer.lap('canada')
}, 1000)
setTimeout(() => clearInterval(lapper), 10000)
timer.logLaps('canada')

took

timer.start('canada')
setTimeout(() => console.log(timer.end('canada').took('canada')), 500)

multiple

const sleepfor = require('sleepfor')
timer.start('eh')
timer.start('canada')

sleepfor(100)
timer.lap('canada')
timer.stop('eh')
sleepfor(100)
timer.lap('canada')

timer
.stop('canada')
.log('eh')
.log('canada')
.logLaps('canada')

// second param is whether to use laps
const lapTime = timer.msTook('canada', true)

formats

timer.start('eh')
timer.stop('eh')

const microseconds = timer.took('eh')
const ms = timer.msTook('eh')
const parsed = timer.parsedTook()