added time.sleep(0) to spinwait so it didn't block other threads. Probably no longer as accurate.

This commit is contained in:
2024-08-06 19:17:40 -07:00
parent 1f06999e5b
commit 965990f0e5
+1 -1
View File
@@ -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],