Founding price: $35, then $99 after 23:59 UTC on 4 November, then $99
Get ProA stopwatch that counts up from the clock, with start, stop, reset and lap times, and does not drift when the tab is throttled.
Derived from this item’s props table, because it declares no controls of its own. This item has no standalone playground, so changes update the code, the share link and the AI prompt.
Use it to show elapsed time: a recording length, a workout, a task timer, a timed quiz.
Do not use it to count down (use useCountdown) or to measure code performance (use performance.now()).
import { useStopwatch } from "@/hooks/use-stopwatch"const { elapsed, isRunning, start, stop, reset, lap, laps } = useStopwatch()useStopwatch(options?): { elapsed, isRunning, start, stop, reset, lap, laps }
| Option | Type | Default | Description |
|---|---|---|---|
tickMs | number | 100 | How often elapsed refreshes. |
elapsed is in milliseconds. start() starts or resumes, stop() pauses and keeps the time, reset() stops and clears time and laps. lap() records the current elapsed time into laps (newest last).
A hook has no markup. Show time as text in a <time> or <output> element, and do not announce every tick; announce lap times and stops instead.
The hook ships with renderHook tests (use-stopwatch.test.ts) covering its behaviour, cleanup on unmount and server-safe defaults. It is safe to render on the server.