UNPKG

logger-timer

Version:

A quick shortcut to adding a bunch of timers and dumping their deltas.

19 lines (18 loc) 528 B
export interface LoggerTimerOptions { isActive: boolean; dumpThreshold: number; } type TimerKey = string; export declare class LoggerTimer { private timerStarts; private timerStops; private isActive; private dumpThreshold; constructor(opts?: LoggerTimerOptions); startTimer(timerName: TimerKey): void; stopTimer(timerName: TimerKey): void; setActive(isActive: boolean): void; getTimerDeltas(): Record<TimerKey, number>; dumpTimers(cb?: (args: string) => void): void; } export {};