diff --git a/Sources/TUIkit/App/App.swift b/Sources/TUIkit/App/App.swift index 684dbf9f..8400a2bb 100644 --- a/Sources/TUIkit/App/App.swift +++ b/Sources/TUIkit/App/App.swift @@ -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 diff --git a/Sources/TUIkit/Notification/NotificationHostModifier.swift b/Sources/TUIkit/Notification/NotificationHostModifier.swift index 34c2fd7f..236e02d7 100644 --- a/Sources/TUIkit/Notification/NotificationHostModifier.swift +++ b/Sources/TUIkit/Notification/NotificationHostModifier.swift @@ -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 diff --git a/Sources/TUIkit/Views/Spinner.swift b/Sources/TUIkit/Views/Spinner.swift index f33a51fa..cc55a72b 100644 --- a/Sources/TUIkit/Views/Spinner.swift +++ b/Sources/TUIkit/Views/Spinner.swift @@ -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)