useTimer API
API reference for the useTimer composable.
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| useTimer | System |
| useRaf | System |
| createQueue | Registration |
Functions
useTimer
(handler: () => void, options?: TimerOptions) => TimerContextCreates a reactive timer with pause/resume support.
Options
duration
MaybeRefOrGetter<number> | undefinedDuration in milliseconds. Accepts a plain number, ref, or getter — the value is read fresh each time `start()` is invoked, so reactive sources can change between runs without recreating the timer.
Default: 1000