# Timers

> Timer patterns: TimelineView for smooth updates, Timer.publish for periodic ticks, countdown/stopwatch formatting. Use when implementing app features related to timers.

- Skill: `abdullah4ai/timers-2` (Agent Skill)
- Install (CLI): `npx get-skill add abdullah4ai/timers-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/abdullah4ai/timers-2/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: abdullah4ai (https://skillmd.com/u/abdullah4ai)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/abdullah4ai/timers-2

---

# Timers

TIMERS:
- Use TimelineView(.animation) for smooth countdown/stopwatch UI
- Timer.publish(every:on:in:).autoconnect() for periodic updates
- @State private var timeRemaining: TimeInterval for countdown state
- .onReceive(timer) { _ in } to update state each tick
- Format with Duration.formatted() or custom mm:ss formatter
- Invalidate timer in .onDisappear to prevent leaks

