Stop Timer
timer_stopStop a running timer and get the official elapsed time in milliseconds. Use trim_to_ms to cap the time if you forgot to stop it.
Instructions
Stop a running timer and get the official elapsed time in milliseconds.
elapsed_ms = (monotonic stop-stamp − monotonic start-stamp) − start_offset_ms − stop_offset_ms. raw_elapsed_ms is the pure unadjusted monotonic difference. Because both stamps are taken server-side, symmetric pipeline latency cancels; offsets exist only to bias out asymmetry if the user wants.
Args:
name (string, default "main"): Which timer to stop.
stop_offset_ms (number, optional): Override the configured stop-side latency handicap for this stop only.
trim_to_ms (number, optional): Cap the recorded time. Use when the user forgot to stop a runaway timer and tells you how long they actually worked (e.g. "I only worked 25 minutes" → trim_to_ms 1500000). The session records the capped time and is flagged trimmed.
Returns: { session: {name, elapsed_ms, raw_elapsed_ms, formatted, splits, pb, pb_margin_ms?, target_ms?, over_under_ms?, id}, announcement, card_path, card_url }
A shareable SVG result card is written on every stop (card_path on disk, card_url served by the dashboard).
IMPORTANT: Relay the 'announcement' to the user — big finish energy if it's a PB. Quote the exact millisecond figure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Timer to stop | main |
| trim_to_ms | No | Cap the recorded time at this many ms (runaway-timer rescue) | |
| stop_offset_ms | No | Latency handicap subtracted from the final time (stop side) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session | Yes | ||
| card_url | Yes | ||
| card_path | Yes | ||
| announcement | Yes |