def mark(self) -> float:
        """Return in appropriate pace.

        Blocks until return can happen in the appropriate pace. Returns time in
        seconds since last mark returned.
        """

        with self._lock:
            while len(self.mark_expirations) >= self.max_marks:
                delay = (
                    self.mark_expirations[0] - datetime.now()
                ).total_seconds()

                if delay >= self.seconds_per_period * 0.5:
                    if not self._warned:
                        self._warned = True
                        logger.warning(
                            """
Pace has a long delay of %s seconds. There might have been a burst of
requests which may become a problem for the receiver of whatever is being paced.
Consider reducing the `seconds_per_period` (currently %s [seconds]) over which to
maintain pace to reduce burstiness. " Alternatively reduce `marks_per_second`
(currently %s [1/second]) to reduce the number of marks
per second in that period.
""",
                            delay,
                            self.seconds_per_period,
                            self.marks_per_second,
                        )

                if delay > 0.0:
                    time.sleep(delay)

                self.mark_expirations.popleft()

            prior_last_mark = self.last_mark
            now = datetime.now()
            self.last_mark = now

            # Add to marks the point at which the mark can be removed (after
            # `period` seconds).
            self.mark_expirations.append(
                now + self.seconds_per_period_timedelta
            )

            return (now - prior_last_mark).total_seconds()
Return in appropriate pace.

        Blocks until return can happen in the appropriate pace. Returns time in
        seconds since last mark returned.
        
src/core/trulens/core/utils/pace.py