{"version":3,"file":"format.cjs","names":[],"sources":["../../src/perf/format.ts"],"sourcesContent":["/**\n * Rendering helpers for the numbers a profiler produces.\n */\n\n/**\n * Format a millisecond duration for display.\n *\n * Sub-second values keep millisecond resolution — the interesting range for a\n * single forward pass — and anything longer switches to seconds so a cold\n * start that pays a model download does not read as a five-digit number.\n * Durations under `1 ms` render as `\"<1 ms\"` rather than `\"0 ms\"`, which\n * would read as \"not measured\".\n *\n * @param value Duration in milliseconds.\n * @returns The formatted string, or `\"—\"` for a non-finite or negative input.\n *\n * @example\n * ```typescript\n * formatDurationMs(0.04);   // \"<1 ms\"\n * formatDurationMs(142.6);  // \"143 ms\"\n * formatDurationMs(4321);   // \"4.32 s\"\n * formatDurationMs(NaN);    // \"—\"\n * ```\n */\nexport function formatDurationMs(value: number): string {\n    if (!Number.isFinite(value) || value < 0) return \"—\";\n    if (value < 1) return \"<1 ms\";\n    if (value < 1000) return `${Math.round(value)} ms`;\n    return `${(value / 1000).toFixed(2)} s`;\n}\n"],"mappings":"AAwBA,SAAgB,EAAiB,EAAuB,CAIpD,MAHI,CAAC,OAAO,SAAS,CAAK,GAAK,EAAQ,EAAU,IAC7C,EAAQ,EAAU,QAClB,EAAQ,IAAa,GAAG,KAAK,MAAM,CAAK,EAAE,KACvC,IAAI,EAAQ,IAAA,CAAM,QAAQ,CAAC,EAAE,GACxC"}