@tdb/util
Version:
Shared helpers and utilities.
10 lines (9 loc) • 336 B
TypeScript
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;