From d6d29c89a1eec2106998e77844dd173620c0fec7 Mon Sep 17 00:00:00 2001 From: occheung Date: Wed, 27 Jul 2022 15:14:42 +0800 Subject: [PATCH] ttl_in/MTD: fix time.sleep duration --- examples/ttl_in.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/ttl_in.py b/examples/ttl_in.py index 320eabd..0e902e5 100644 --- a/examples/ttl_in.py +++ b/examples/ttl_in.py @@ -75,7 +75,10 @@ class MeanTimestampDuration(EnvExperiment): # Guarantee t0 > gate_end_mu # Otherwise timestamp_mu may wait for pulses till gate_end_mu - self.rpc_sleep(1*ms) + rtio_time_mu = self.core.get_rtio_counter_mu() + sleep_mu = float(gate_end_mu - rtio_time_mu) + self.rpc_sleep(self.core.mu_to_seconds(sleep_mu)) + t0 = self.core.get_rtio_counter_mu() while self.ttlin.timestamp_mu(gate_end_mu) >= 0: pass