UNPKG

@tdb/util

Version:
10 lines (9 loc) 336 B
import { moment } from '../../libs'; export declare type TimerUnit = 'msec' | 'ms' | 'sec' | 's'; export declare type ITimer = { startedAt: Date; reset: () => ITimer; elapsed: (unit?: TimerUnit) => number; }; export declare function timer(start?: Date): ITimer; export declare function elapsed(from: Date): moment.Duration;