1 // Hack up our own formatting for the duration to make it easier for scripts
2 // to parse (always use the same number of decimal places and the same unit).
3 pub fn duration_to_secs_str(dur: std::time::Duration) -> String {
4 const NANOS_PER_SEC: f64 = 1_000_000_000.0;
5 let secs = dur.as_secs() as f64 +
6 dur.subsec_nanos() as f64 / NANOS_PER_SEC;