pub fn duration_to_float(duration: Duration) -> f64
Converts the duration into a number of seconds with fractions.