Chore: Increase frame rate from ~35 FPS to ~42 FPS

- Reduce run loop sleep from 28ms to ~24ms
- Update notification and spinner timers to match
This commit is contained in:
phranck
2026-02-15 02:35:26 +01:00
parent db8ea40c0a
commit d9c8a934b5
3 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -187,10 +187,10 @@ extension AppRunner {
eventsProcessed += 1
}
// Sleep 28ms to yield CPU.
// This sets the maximum frame rate to ~35 FPS.
// Sleep ~24ms to yield CPU.
// This sets the maximum frame rate to ~42 FPS.
//
usleep(28_000)
usleep(23_800)
}
// Stop pulse timer before cleanup
@@ -162,7 +162,7 @@ private extension NotificationHostModifier {
.max() ?? 0
lifecycle.startTask(token: token, priority: .medium) { [lifecycle] in
let triggerNanos: UInt64 = 28_000_000 // 28ms (~35 FPS)
let triggerNanos: UInt64 = 23_800_000 // ~24ms (~42 FPS)
while !Task.isCancelled {
let now = Date().timeIntervalSinceReferenceDate
+1 -1
View File
@@ -282,7 +282,7 @@ private struct _SpinnerCore: View, Renderable {
if !lifecycle.hasAppeared(token: token) {
_ = lifecycle.recordAppear(token: token) {}
let triggerNanos: UInt64 = 28_000_000 // 28ms matches run loop poll rate (~35 FPS)
let triggerNanos: UInt64 = 23_800_000 // ~24ms matches run loop poll rate (~42 FPS)
lifecycle.startTask(token: token, priority: .medium) {
while !Task.isCancelled {
try? await Task.sleep(nanoseconds: triggerNanos)