From 965990f0e508656701ccc2bd71623554da8e6047 Mon Sep 17 00:00:00 2001 From: Josh Miklos Date: Tue, 6 Aug 2024 19:17:40 -0700 Subject: [PATCH] added time.sleep(0) to spinwait so it didn't block other threads. Probably no longer as accurate. --- displayarray/frame/frame_publishing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/displayarray/frame/frame_publishing.py b/displayarray/frame/frame_publishing.py index 9a12bf2..2f06024 100644 --- a/displayarray/frame/frame_publishing.py +++ b/displayarray/frame/frame_publishing.py @@ -40,7 +40,7 @@ def spinwait_us(delay): # thx: https://stackoverflow.com/a/74247651/782170 target = time.perf_counter_ns() + delay * 1000 while time.perf_counter_ns() < target: - pass + time.sleep(0) def pub_cam_loop_pyv4l2( cam_id: Union[int, str, np.ndarray],