mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-02-16 01:26:29 -05:00
hotfix: time.time -> time.perf_counter
This commit is contained in:
@@ -209,8 +209,8 @@ class HCQSignal(Generic[DeviceType]):
|
||||
value: The value to wait for.
|
||||
timeout: Maximum time to wait in milliseconds. Defaults to 10s.
|
||||
"""
|
||||
start_time = int(time.time() * 1000)
|
||||
while self.value < value and (time_spent:=int(time.time() * 1000) - start_time) < timeout:
|
||||
start_time = int(time.perf_counter() * 1000)
|
||||
while self.value < value and (time_spent:=int(time.perf_counter() * 1000) - start_time) < timeout:
|
||||
self._sleep(time_spent)
|
||||
if self.value < value: raise RuntimeError(f"Wait timeout: {timeout} ms! (the signal is not set to {value}, but {self.value})")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user