()
| 136 | * end(); |
| 137 | */ |
| 138 | export function startStreamingLatencyMeasurement(): () => void { |
| 139 | const start = performance.now(); |
| 140 | return () => { |
| 141 | const value = performance.now() - start; |
| 142 | report({ name: "streaming_token_latency_ms", value }); |
| 143 | }; |
| 144 | } |
| 145 | |
| 146 | /** Monitor scroll FPS during user scrolling. Returns a cleanup fn. */ |
| 147 | export function monitorScrollFps(element: HTMLElement): () => void { |