/** * Lightweight stopwatch utility for profiling hot paths and measuring named checkpoints. * * The timer starts immediately on construction and can report durations in milliseconds or seconds. * It also keeps optional named checkpoints so callers can inspect elapsed time between milestones * without managing multiple timer instances. */ export declare class PerformanceTimer { private start; private readonly checkpoints; private accumulateContainer; constructor(); getDuration(): number; getDurationSeconds(): number; /** * Resets the timer and returns the elapsed duration in milliseconds from the previous interval. * * @returns Duration measured before the reset. */ reset(): number; resetSeconds(): number; /** * Resets the timer, stores the previous interval in the accumulation buffer, and returns the average * of the most recent samples in milliseconds. * * @param samples Maximum number of recent samples to average. * @returns Rolling average duration in milliseconds. */ accumulate(samples: number): number; accumulateSeconds(samples: number): number; /** * Stores the current elapsed time under a checkpoint name. * * @param name Caller-defined checkpoint identifier. * @returns Elapsed time in milliseconds at the moment the checkpoint was recorded. */ checkpoint(name: string): number; checkpointSeconds(name: string): number; getCheckpoint(name: string): number | undefined; getCheckpoints(): Map; /** * Computes the time elapsed since a previously recorded checkpoint. * * @param name Checkpoint identifier to measure from. * @returns Milliseconds elapsed since the checkpoint, or `undefined` if it does not exist. */ getTimeFromCheckpoint(name: string): number | undefined; getTimeFromCheckpointSeconds(name: string): number | undefined; /** * Measures the delta between two recorded checkpoints. * * @param checkpointFrom Start checkpoint name. * @param checkpointTo End checkpoint name. * @returns Difference in milliseconds, or `undefined` when either checkpoint is missing. */ getCheckpointDifference(checkpointFrom: string, checkpointTo: string): number | undefined; getCheckpointDifferenceSeconds(checkpointFrom: string, checkpointTo: string): number | undefined; }