From d4f6703e3fecdb8debfe64a9559669c27683ae90 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Tue, 28 Apr 2020 15:29:15 -0700 Subject: [PATCH] No looping old-commit-hash: c4f62b4b8e6720aaccb8cb64882cba8b62992189 --- tools/replay/unlog_segment.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/replay/unlog_segment.py b/tools/replay/unlog_segment.py index 88034d780e..1e1f7de50a 100755 --- a/tools/replay/unlog_segment.py +++ b/tools/replay/unlog_segment.py @@ -62,8 +62,8 @@ def replay(route, segment): lag -= dt time.sleep(dt) - if lag < -1 and i % 100 == 0: - print(f"{-lag} s behind") + if lag < -1.0 and i % 1000 == 0: + print(f"{-lag:.2f} s behind") if input_ready(): key = sys.stdin.read(1) @@ -80,7 +80,7 @@ def replay(route, segment): new_time = msgs[i].logMonoTime + dt * 1e9 i = bisect.bisect_left(times, new_time) - i = (i + 1) % max_i + i = min(i + 1, max_i) if __name__ == "__main__":