Skip to main content

complete_count_constant

Function complete_count_constant 

Source
pub fn complete_count_constant(
    utc_us: i128,
    ast_us: i128,
    period_start_us: i128,
    ato_us: i128,
    duration_ticks: u64,
    timescale: u64,
) -> u64
Expand description

Number of complete segments of constant duration duration_ticks at utc_us: the largest n with AST + PS + n * d - ATO <= utc, computed exactly against per-segment microsecond rounding (floor(n * d * 1e6 / timescale)).