(self)
Return the elapsed time taken to complete the trial.

        Returns:
            The duration.
Return the elapsed time taken to complete the trial.
Return the elapsed time taken to complete the trial .
def duration(self) -> Optional[datetime.timedelta]:
        """Return the elapsed time taken to complete the trial.

        Returns:
            The duration.
        """

        if self.datetime_start and self.datetime_complete:
            return self.datetime_complete - self.datetime_start
        else:
            return None
def duration ( self ) -> Optional [ datetime . timedelta ] : if self . datetime_start and self . datetime_complete : return self . datetime_complete - self . datetime_start else : return None