diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-21 18:00:59 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-21 18:00:59 +0300 |
| commit | bc410c4261f12377a2eb7ea08f4112a1a9574a77 (patch) | |
| tree | 99fef6ff2406c9be4147e63b0145f89c612261ea /src/app/runtime.rs | |
| parent | b1c9833b828d12e7e0196c5607ae63372998e25a (diff) | |
perf: reduce headless server render overhead
Diffstat (limited to 'src/app/runtime.rs')
| -rw-r--r-- | src/app/runtime.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/app/runtime.rs b/src/app/runtime.rs index b6ad806b..739a3670 100644 --- a/src/app/runtime.rs +++ b/src/app/runtime.rs @@ -1,4 +1,4 @@ -use std::time::Instant; +use std::time::{Duration, Instant}; use crossterm::terminal; @@ -171,9 +171,16 @@ impl App { } pub(crate) fn sync_animation_timer(&mut self, now: Instant) { + self.sync_animation_timer_with_interval(now, ANIMATION_INTERVAL); + } + + pub(crate) fn sync_headless_animation_timer(&mut self, now: Instant) { + self.sync_animation_timer_with_interval(now, crate::app::HEADLESS_ANIMATION_INTERVAL); + } + + fn sync_animation_timer_with_interval(&mut self, now: Instant, interval: Duration) { if self.agent_panel_has_animation() { - self.next_animation_tick - .get_or_insert(now + ANIMATION_INTERVAL); + self.next_animation_tick.get_or_insert(now + interval); } else { self.next_animation_tick = None; } |
