File size: 318 Bytes
f1bfa1e
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import cfg from "../config/gemini.config.json";
export async function withTrace<T>(name: string, fn: () => Promise<T>) {
  const start = Date.now();
  try { return await fn(); }
  finally {
    if (cfg.telemetry.enabled) {
      const ms = Date.now() - start;
      console.log(`[TRACE] ${name} ${ms}ms`);
    }
  }
}