pub fn check_live_delta(
    timer: &Snapshot<'_>,
    split_delta: bool,
    comparison: &str,
    method: TimingMethod,
) -> Option<TimeSpan> {
    if timer.current_phase() == TimerPhase::Running || timer.current_phase() == TimerPhase::Paused {
        let current_split = timer
            .current_split()
            .unwrap()
            .comparison_timing_method(comparison, method);
        let current_time = timer.current_time()[method];
        let segment_index = timer.current_split_index().unwrap();
        let current_segment = live_segment_time(timer, segment_index, method);
        let best_segment = timer.run().segment(segment_index).best_segment_time()[method];
        let best_segment_delta =
            live_segment_delta(timer, segment_index, best_segments::NAME, method);
        let comparison_delta = live_segment_delta(timer, segment_index, comparison, method);

        if split_delta && current_time > current_split
            || catch! { current_segment? > best_segment? }.unwrap_or(false)
                && best_segment_delta.map_or(false, |d| d > TimeSpan::zero())
            || comparison_delta.map_or(false, |d| d > TimeSpan::zero())
        {
            if split_delta {
                return catch! { current_time? - current_split? };
            } else {
                return comparison_delta;
            }
        }
    }
    None
}
/// Checks whether the live segment should now be shown.
///
/// - `timer`: The current timer.
/// - `split_delta`: Specifies whether to return a split delta
///    rather than a segment delta and to start showing the live
///    segment once you are behind.
/// - `comparison`: The comparison that you are comparing with.
/// - `method`: The timing method that you are using.
///
/// Returns the current live delta.
Checks whether the live segment should now be shown.
`timer`: The current timer.
`split_delta`: Specifies whether to return a split delta
rather than a segment delta and to start showing the live
segment once you are behind.
`comparison`: The comparison that you are comparing with.
`method`: The timing method that you are using.

Returns the current live delta.
Checks whether the live segment should now be shown . ` timer ` : The current timer . ` split_delta ` : Specifies whether to return a split delta rather than a segment delta and to start showing the live segment once you are behind . ` comparison ` : The comparison that you are comparing with . ` method ` : The timing method that you are using . Returns the current live delta .
pub fn check_live_delta(
    timer: &Snapshot<'_>,
    split_delta: bool,
    comparison: &str,
    method: TimingMethod,
) -> Option<TimeSpan> {
    if timer.current_phase() == TimerPhase::Running || timer.current_phase() == TimerPhase::Paused {
        let current_split = timer
            .current_split()
            .unwrap()
            .comparison_timing_method(comparison, method);
        let current_time = timer.current_time()[method];
        let segment_index = timer.current_split_index().unwrap();
        let current_segment = live_segment_time(timer, segment_index, method);
        let best_segment = timer.run().segment(segment_index).best_segment_time()[method];
        let best_segment_delta =
            live_segment_delta(timer, segment_index, best_segments::NAME, method);
        let comparison_delta = live_segment_delta(timer, segment_index, comparison, method);
        if split_delta && current_time > current_split
            || catch! { current_segment? > best_segment? }.unwrap_or(false)
                && best_segment_delta.map_or(false, |d| d > TimeSpan::zero())
            || comparison_delta.map_or(false, |d| d > TimeSpan::zero())
        {
            if split_delta {
                return catch! { current_time? - current_split? };
            } else {
                return comparison_delta;
            }
        }
    }
    None
}
pub fn check_live_delta ( timer : & Snapshot < ' _ > , split_delta : bool , comparison : & str , method : TimingMethod , ) -> Option < TimeSpan > { if timer . current_phase ( ) == TimerPhase :: Running || timer . current_phase ( ) == TimerPhase :: Paused { let current_split = timer . current_split ( ) . unwrap ( ) . comparison_timing_method ( comparison , method ) ; let current_time = timer . current_time ( ) [ method ] ; let segment_index = timer . current_split_index ( ) . unwrap ( ) ; let current_segment = live_segment_time ( timer , segment_index , method ) ; let best_segment = timer . run ( ) . segment ( segment_index ) . best_segment_time ( ) [ method ] ; let best_segment_delta = live_segment_delta ( timer , segment_index , best_segments :: NAME , method ) ; let comparison_delta = live_segment_delta ( timer , segment_index , comparison , method ) ; if split_delta && current_time > current_split || catch ! { current_segment best_segment } . unwrap_or ( false ) && best_segment_delta . map_or ( false , | d | d > TimeSpan :: zero ( ) ) || comparison_delta . map_or ( false , | d | d > TimeSpan :: zero ( ) ) { if split_delta { return catch ! { current_time current_split } ; } else { return comparison_delta ; } } } None }
Checks whether the live segment should now be shown.
Checks whether the live segment should now be shown .
timer
&Snapshot<'_>
split_delta
bool
comparison
&str
method
TimingMethod
timer
&Snapshot<'_>
split_delta
bool
comparison
&str
method
TimingMethod