pub(crate) fn sample_timestamp_ns(
first_sample_unix_ns: u64,
sample_interval_ns: u64,
index: usize,
) -> Result<i64, String>Expand description
Computes the Unix timestamp for a sample index within a FlatBuffer scan.
§Arguments
first_sample_unix_ns- Time of the scan’s first sample, in Unix nanoseconds.sample_interval_ns- Time between samples, in nanoseconds.index- Zero-based sample index within the scan.
§Returns
first_sample_unix_ns + sample_interval_ns * index, in Unix nanoseconds.
§Errors
Returns an error if the result does not fit in an i64.
§Examples
sample_timestamp_ns(1_000, 500_000, 3) == Ok(1_501_000)