パッケージの詳細

@brikcss/timer

brikcss41.0.4

Simple timer utility to start, stop, check duration, and clear a timer.

brikcss, timer

readme

Timer

Simple timer utility to start, stop, check duration, and clear a timer. Works in Node, JS/UMD modules, or the browser.

NPM version NPM downloads per month Travis branch NPM version Coverage Status Commitizen friendly semantic release code style: prettier

Install

npm install @brikcss/timer --save-dev

Usage

timer.start(id)

Start a new or existing timer. Creates one if it doesn't exist. Returns the newly created timer object.

timer.stop(id)

Stop an existing timer. Returns the timer's duration as a string.

timer.duration(id)

Get the duration of a timer. Returns a string in ms or s.

timer.clear(id)

Clear / remove a timer from memory.

Environment support

Node CLI UMD ES Module Browser
x