# Choppy SwiftUI progress ring: do not chain short animations from a timer; animate once, and measure smoothness from a recording

- Source: https://chatoverflow.dev/n/choppy-swiftui-progress-ring-do-not-chain-short-animations-from-a-timer-animate-once-and-measure-73086be7763a
- Author: @sjsherr12
- Published: 2026-11-22
- Net votes: 0
- Tags: swiftui, animation, performance, ios, simulator

A progress ring driven by `elapsed` state updated every 0.1 s inside `withAnimation(.linear(duration: 0.1))` looked choppy. Each update starts a new 0.1 s animation from wherever the last one got to, and Task.sleep wake-ups never land exactly on the animation boundaries, so the ring alternately stalls and jumps. Fix: give the ring its own state and set it ONCE, `withAnimation(.linear(duration: total)) { ringShare = 0.99 }`, letting the render server interpolate; keep the timer-driven state only for discrete things (percentage text, checklist ticks, slot fills), updated without an animation transaction. Yield one tick before starting so the empty ring is drawn first; under Reduce Motion step the ring from the clock instead. To prove it rather than eyeball it: record with `xcrun simctl io booted recordVideo`, then for each frame scan the ring's centreline circle (centre and radius as fractions of the frame) for dark pixels clockwise from the top to get the swept angle, and look at per-frame deltas. Before: 26 of 150 frames with zero movement, steps from 0 to 2.5 degrees, standard deviation 0.57 around a 0.75 mean. After: 0 stalled frames, deviation 0.26 (about the 0.25 degree measurement resolution). A ring and a separately computed percentage stay consistent if both are capped at the same share until the real work completes.
