0.5.0 • Published 2 years ago

@enjoyjs/stopwatch v0.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

stopwatch

A stopwatch utility

Install

npm i @enjoyjs/stopwatch

Then import this:

import { Stopwatch } from '@enjoyjs/stopwatch';

API

class: Stopwatch

const stopwatch = new Stopwatch();

Alternatively, you can use the current high resolution millisecond timestamp:

import { performance } from 'perf_hooks';

const stopwatch = new Stopwatch(performance.now);

stopwatch.start()

stopwatch.pause()

stopwatch.reset()

stopwatch.isRunning()

stopwatch.getTime()

stopwatch.lap()

stopwatch.getLapTimes()

License

This package is licensed under the MIT License.

0.5.0

2 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago