Skip to main content

elapsed_tiers

Function elapsed_tiers 

Source
pub fn elapsed_tiers(
    seconds: u64,
) -> (u64, ElapsedUnit, Option<(u64, ElapsedUnit)>)
Expand description

Decompose an elapsed second count into at most two display tiers ((primary, unit, optional remainder)).

Zero remainder parts are omitted by returning None, so each surface only has to map the units to its own presentation (compact symbols here, locale catalog keys in the desktop app). Keeping the boundary arithmetic here means a tier change is made once instead of being mirrored in every renderer.