diff --git a/scripts/led-matrix-viz.py b/scripts/led-matrix-viz.py index 818df6c..2134d4e 100644 --- a/scripts/led-matrix-viz.py +++ b/scripts/led-matrix-viz.py @@ -94,6 +94,7 @@ def main(): frames_sent = 0 frames_dropped = 0 router_errors = 0 + stats_last_write = time.monotonic() while True: now = time.monotonic() @@ -193,9 +194,9 @@ def main(): last_frame = frame # Write stats periodically (every 2s) - if now - _stats_last_write >= 2.0: + if now - stats_last_write >= 2.0: _write_stats(frames_sent, frames_dropped, pending_frames) - _stats_last_write = now + stats_last_write = now _stats_last_write = 0.0