diff --git a/ohmpi/hardware_system.py b/ohmpi/hardware_system.py index 2ec85791c81d522beb730d47156c5f5fab3e8d93..69c1577ad472c164562cd82c4a0ae82d85490a74 100644 --- a/ohmpi/hardware_system.py +++ b/ohmpi/hardware_system.py @@ -173,11 +173,11 @@ class OhmPiHardware: self.rx.voltage]) sample += 1 sleep_time = self._start_time + datetime.timedelta(seconds=sample * sampling_rate / 1000) - lap - if sleep_time < 0.: - _readings.append([elapsed_seconds(self._start_time), self._pulse, self.tx.polarity, np.nan, np.nan]) # TODO: + if sleep_time.total_seconds() < 0.: + _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()])) # TODO: set readings to nan if sleep time <0 and skip the sample (sample +=1) + time.sleep(np.max([0., sleep_time.total_seconds()])) self.exec_logger.warning(f'pulse {self._pulse}: elapsed time {(lap-self._start_time).total_seconds()} s') # TODO: Set to debug level self.exec_logger.warning(f'pulse {self._pulse}: total samples {len(_readings)}') # TODO: Set to debug level