A stopwatch utility
npm i @enjoyjs/stopwatchThen import this:
import { Stopwatch } from '@enjoyjs/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);This package is licensed under the MIT License.