def end(self):
        """
        This method must be called after the operation returns.
        Note that this method is not to be invoked by the user; it is invoked
        by the implementation of the :class:`~zhmcclient.Session` class.

        If the statistics keeper holding this time statistics is enabled, this
        method takes the current time, calculates the duration of the operation
        since the last call to :meth:`~zhmcclient.TimeStats.begin`, and updates
        the time statistics to reflect the new operation.

        If the statistics keeper holding this time statistics is disabled,
        this method does nothing, in order to save resources.

        If this method is called without a preceding call to
        :meth:`~zhmcclient.TimeStats.begin`, a :exc:`py:RuntimeError` is
        raised.

        Raises:
          RuntimeError
        """
        if self.keeper.enabled:
            if self._begin_time is None:
                raise RuntimeError("end() called without preceding begin()")
            dt = time.time() - self._begin_time
            self._begin_time = None
            self._count += 1
            self._sum += dt
            if dt > self._max:
                self._max = dt
            if dt < self._min:
                self._min = dt