From 11e6bd762a6fd558b470849d5d72253dceb784ef Mon Sep 17 00:00:00 2001 From: Caroline Pascal Date: Fri, 8 Aug 2025 10:46:14 +0200 Subject: [PATCH] fix(busy_wait): fix busy_wait implementation for Windows platforms and removing erronous TODO (#1695) --- src/lerobot/utils/robot_utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lerobot/utils/robot_utils.py b/src/lerobot/utils/robot_utils.py index e6c0cfe6d..8069b3662 100644 --- a/src/lerobot/utils/robot_utils.py +++ b/src/lerobot/utils/robot_utils.py @@ -17,10 +17,9 @@ import time def busy_wait(seconds): - if platform.system() == "Darwin": - # On Mac, `time.sleep` is not accurate and we need to use this while loop trick, + if platform.system() == "Darwin" or platform.system() == "Windows": + # On Mac and Windows, `time.sleep` is not accurate and we need to use this while loop trick, # but it consumes CPU cycles. - # TODO(rcadene): find an alternative: from python 11, time.sleep is precise end_time = time.perf_counter() + seconds while time.perf_counter() < end_time: pass