Latency Breakdown
ProNewWhere the time in one voice turn goes: stages end to end on one bar that fills in order, a marker at the target, and the total stated against it.
Installation
pnpm dlx shadcn@latest add @viewport/latency-breakdown
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| title* | stringWhat is being timed, e.g. "Time to first audio". | — |
| stages* | LatencyStage[]The stages of one turn, in the order they happen, e.g. speech to text, the model, text to speech. | — |
| targetMs | numberThe total you are aiming for, in milliseconds. A marker is drawn there and the result is stated against it. | — |
| hint | stringA note at the end of the heading, e.g. "p50, last 24 hours". | — |
| className | string | — |
Accessibility
- Every stage is listed with its milliseconds and share; the bar is not the only source.
- Over or under target is written out, not only colored.
- Stages can be focused to isolate them.
- The bar is shown filled under reduced motion.