@enjoyjs/stopwatch
v0.5.0
Published
A stopwatch utility
Readme
stopwatch
A stopwatch utility
Install
npm i @enjoyjs/stopwatchThen 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.
