Skip to main content

format_run_duration

Function format_run_duration 

Source
pub fn format_run_duration(
    started_at: DateTime<Utc>,
    finished_at: Option<DateTime<Utc>>,
) -> String
Expand description

Format a run duration, using finished_at if available, otherwise live from now.

When finished_at is Some, computes a fixed duration finished_at - started_at. When finished_at is None, falls back to Utc::now() - started_at (live counter).