UNPKG

@dbpiper/timer

Version:

Simple module to time your code JavaScript or TypeScript code, to see how long it took to run.

22 lines (21 loc) 509 B
import FormattedDuration from './formatted-duration'; declare class Timer { private _startTime; private _stopTime; constructor(); /** * Start running the timer. * * @memberof Timer */ start: () => void; /** * Stops the timer, and returns how much time passed. * * @returns The amounted of time taken as a FormattedDuration object * @memberof Timer */ stop: () => FormattedDuration; } export { FormattedDuration }; export default Timer;