Skip to content

Commit d084347

Browse files
committed
make timings more precise
1 parent 3ae0a42 commit d084347

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc/util/common.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,13 @@ fn time_threads_impl<T, F>(what: &str, f: F) -> T where
205205
let total_thread_time: u64 = thread_times.iter().cloned().sum();
206206
let core_usage = total_thread_time as f64 / time as f64;
207207

208-
let mut data = format!("{:.3} - cores {:.2}x - cpu {:.2}% - threads (",
208+
let mut data = format!("{:.6} - cores {:.2}x - cpu {:.2} - threads (",
209209
time_secs,
210210
core_usage,
211-
core_usage * 100.0 / (thread_times.len() - 1) as f64);
211+
core_usage / (thread_times.len() - 1) as f64);
212212

213213
for (i, thread_time) in thread_times.into_iter().enumerate() {
214-
data.push_str(&format!("{:.2}x", thread_time as f64 / time as f64));
214+
data.push_str(&format!("{:.2}", thread_time as f64 / time as f64));
215215
if i == 0 {
216216
data.push_str(" - ");
217217
}
@@ -269,7 +269,7 @@ pub fn duration_to_secs_str(dur: Duration) -> String {
269269
let secs = dur.as_secs() as f64 +
270270
dur.subsec_nanos() as f64 / NANOS_PER_SEC;
271271

272-
format!("{:.3}", secs)
272+
format!("{:.6}", secs)
273273
}
274274

275275
pub fn to_readable_str(mut val: usize) -> String {

0 commit comments

Comments
 (0)