Skip to content

Commit 43193dc

Browse files
committed
Use as_secs_f64 in profiling.rs
1 parent cebbd9f commit 43193dc

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

compiler/rustc_data_structures/src/profiling.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,10 +600,7 @@ pub fn print_time_passes_entry(do_it: bool, what: &str, dur: Duration) {
600600
// Hack up our own formatting for the duration to make it easier for scripts
601601
// to parse (always use the same number of decimal places and the same unit).
602602
pub fn duration_to_secs_str(dur: std::time::Duration) -> String {
603-
const NANOS_PER_SEC: f64 = 1_000_000_000.0;
604-
let secs = dur.as_secs() as f64 + dur.subsec_nanos() as f64 / NANOS_PER_SEC;
605-
606-
format!("{:.3}", secs)
603+
format!("{:.3}", dur.as_secs_f64())
607604
}
608605

609606
// Memory reporting

0 commit comments

Comments
 (0)