diff --git a/ohmpi/hardware_system.py b/ohmpi/hardware_system.py index 157b5ea7f8821b4d16056a022642f1dee2fc6892..6289768fa5364bf06e552c85cacfaee95bdfef4b 100644 --- a/ohmpi/hardware_system.py +++ b/ohmpi/hardware_system.py @@ -174,8 +174,9 @@ class OhmPiHardware: sample += 1 sleep_time = self._start_time + datetime.timedelta(seconds=sample / sampling_rate) - lap if sleep_time.total_seconds() < 0.: - _readings.append([elapsed_seconds(self._start_time), self._pulse, self.tx.polarity, np.nan, np.nan]) - sample += 1 + for i in range(int(sampling_rate * np.abs(sleep_time.total_seconds()))): + _readings.append([elapsed_seconds(self._start_time), self._pulse, self.tx.polarity, np.nan, np.nan]) + sample += 1 else: time.sleep(np.max([0., sleep_time.total_seconds()]))