ttl_in/MTD: fix time.sleep duration

This commit is contained in:
occheung 2022-07-27 15:14:42 +08:00
parent a7dfa03a21
commit d6d29c89a1
1 changed files with 4 additions and 1 deletions

View File

@ -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