Skip to main content

bucket_of

Function bucket_of 

Source
const fn bucket_of(ns: u64) -> usize
Expand description

Which bucket ns falls in: two significant bits per octave.

Buckets 0-3 are the exact values 0-3; from there each octave is split into four, so a bucket is at most 25% wider than its lower bound. Bucket 127 covers everything from 2^32 ns (4.29 s) upward — lateness past that saturates, and ReleaseErrors::max_ns stays exact.