Skip to content

Commit 386a328

Browse files
authored
Fix timing information in cranelift (#13253)
A typo in #12709 accidentally led to all passes clocking in at 0ns. Swap the order of arguments to get true timing information.
1 parent 79a81e5 commit 386a328

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cranelift/codegen/src/timing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ mod enabled {
291291
impl Drop for DefaultTimingToken {
292292
fn drop(&mut self) {
293293
let now = monotonic_instant();
294-
let duration = self.start.duration_since(now);
294+
let duration = now.duration_since(self.start);
295295
log::debug!("timing: Ending {}: {}ms", self.pass, duration.as_millis());
296296
let old_cur = CURRENT_PASS.with(|p| p.replace(self.prev));
297297
assert_eq!(self.pass, old_cur, "Timing tokens dropped out of order");

0 commit comments

Comments
 (0)