Skip to main content

timestamps

Function timestamps 

Source
pub fn timestamps(end: i64, span_secs: i64, points: usize) -> Vec<i64>
Available on crate feature vcs-git only.
Expand description

The points Unix-second timestamps a trend samples, evenly spaced across span_secs and ending at end (the most recent point is exactly end, the oldest is end - span_secs). Returned oldest-first.

Integer division places the interior points; the two endpoints are exact regardless of rounding. points is assumed already validated by validate_points (>= MIN_TREND_POINTS), so the points - 1 divisor is always positive. This function does not re-check that precondition: a direct caller passing an arbitrarily large points allocates a Vec<i64> of that length (the MAX_TREND_POINTS upper bound is enforced only by validate_points, not here).