code: def duration(self):
          
          if self.end_datetime is None or self.start_datetime is None:
              return 0
          return (self.end_datetime - self.start_datetime).total_seconds()
docs: The duration of running the impact function in seconds.
  
          Return 0 if the start or end datetime is None.
  
          :return: The duration.
          :rtype: float