pub fn duration_to_float(duration: Duration) -> f64
Converts the duration into a number of seconds with fractions.
(There’s now a native Duration::as_secs_f64.)
Duration::as_secs_f64