pub fn time_ns<R>(f: impl FnOnce() -> R) -> (R, u64)
Time f, returning (result, elapsed_ns). Inlined so the surrounding loop can keep the closure body in registers.
f
(result, elapsed_ns)