diff --git a/tinygrad/runtime/support/hcq.py b/tinygrad/runtime/support/hcq.py index dedee3c341..a267714dad 100644 --- a/tinygrad/runtime/support/hcq.py +++ b/tinygrad/runtime/support/hcq.py @@ -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})")