mirror of
https://github.com/KeygraphHQ/shannon.git
synced 2026-05-21 08:16:55 +02:00
16de74e0be
- Remove empty section markers (// === ... ===, // --- ... ---) that duplicate JSDoc or function names - Remove "what" comments that restate the next line of code (e.g. // Save to disk, // Check for retryable patterns) - Remove file-level descriptions that restate the filename (e.g. // Pure functions for formatting console output) - Fix "Added by client" comment referencing implementation history → "Used for audit correlation" - Preserve all WHY comments: error classification groups, billing/session limit explanations, ESM interop, exactOptionalPropertyTypes, mutex reasoning
27 lines
606 B
TypeScript
27 lines
606 B
TypeScript
// Copyright (C) 2025 Keygraph, Inc.
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Affero General Public License version 3
|
|
// as published by the Free Software Foundation.
|
|
|
|
export class Timer {
|
|
name: string;
|
|
startTime: number;
|
|
endTime: number | null = null;
|
|
|
|
constructor(name: string) {
|
|
this.name = name;
|
|
this.startTime = Date.now();
|
|
}
|
|
|
|
stop(): number {
|
|
this.endTime = Date.now();
|
|
return this.duration();
|
|
}
|
|
|
|
duration(): number {
|
|
const end = this.endTime || Date.now();
|
|
return end - this.startTime;
|
|
}
|
|
}
|