Skip to content

Commit 11e6bd7

Browse files
fix(busy_wait): fix busy_wait implementation for Windows platforms and removing erronous TODO (#1695)
1 parent ce3b9f6 commit 11e6bd7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lerobot/utils/robot_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717

1818

1919
def busy_wait(seconds):
20-
if platform.system() == "Darwin":
21-
# On Mac, `time.sleep` is not accurate and we need to use this while loop trick,
20+
if platform.system() == "Darwin" or platform.system() == "Windows":
21+
# On Mac and Windows, `time.sleep` is not accurate and we need to use this while loop trick,
2222
# but it consumes CPU cycles.
23-
# TODO(rcadene): find an alternative: from python 11, time.sleep is precise
2423
end_time = time.perf_counter() + seconds
2524
while time.perf_counter() < end_time:
2625
pass

0 commit comments

Comments
 (0)