Use as_secs_f64 in profiling.rs
This commit is contained in:
parent
cebbd9fcd3
commit
43193dcb88
1 changed files with 1 additions and 4 deletions
|
@ -600,10 +600,7 @@ pub fn print_time_passes_entry(do_it: bool, what: &str, dur: Duration) {
|
||||||
// Hack up our own formatting for the duration to make it easier for scripts
|
// Hack up our own formatting for the duration to make it easier for scripts
|
||||||
// to parse (always use the same number of decimal places and the same unit).
|
// to parse (always use the same number of decimal places and the same unit).
|
||||||
pub fn duration_to_secs_str(dur: std::time::Duration) -> String {
|
pub fn duration_to_secs_str(dur: std::time::Duration) -> String {
|
||||||
const NANOS_PER_SEC: f64 = 1_000_000_000.0;
|
format!("{:.3}", dur.as_secs_f64())
|
||||||
let secs = dur.as_secs() as f64 + dur.subsec_nanos() as f64 / NANOS_PER_SEC;
|
|
||||||
|
|
||||||
format!("{:.3}", secs)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Memory reporting
|
// Memory reporting
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue