Skip to content

timing

orchard.core.environment.timing

Pipeline Timing Utilities.

Provides time tracking for pipeline execution duration measurement. Used by RootOrchestrator to report total execution time.

TimeTrackerProtocol

Bases: Protocol

Protocol for pipeline duration tracking.

elapsed_seconds property

Total elapsed time in seconds.

elapsed_formatted property

Human-readable elapsed time string.

start()

Record pipeline start time.

Source code in orchard/core/environment/timing.py
def start(self) -> None:
    """Record pipeline start time."""
    ...  # pragma: no cover

stop()

Record stop time and return elapsed seconds.

Source code in orchard/core/environment/timing.py
def stop(self) -> float:
    """Record stop time and return elapsed seconds."""
    ...  # pragma: no cover

TimeTracker()

Default implementation of TimeTrackerProtocol.

Tracks elapsed time between start() and stop() calls, providing both raw seconds and formatted output.

Source code in orchard/core/environment/timing.py
def __init__(self) -> None:
    self._start_time: float | None = None
    self._end_time: float | None = None

elapsed_seconds property

Total elapsed time in seconds.

elapsed_formatted property

Human-readable elapsed time string (e.g., '1h 23m 45s').

start()

Record pipeline start time.

Source code in orchard/core/environment/timing.py
def start(self) -> None:
    """Record pipeline start time."""
    self._start_time = time.time()
    self._end_time = None

stop()

Record stop time and return elapsed seconds.

Source code in orchard/core/environment/timing.py
def stop(self) -> float:
    """Record stop time and return elapsed seconds."""
    self._end_time = time.time()
    return self.elapsed_seconds