From 8b664c34e974d8d31552d5e452489f1ace9a123e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 1 May 2026 16:54:20 -0700 Subject: [PATCH] Fix timing information in cranelift A typo in #12709 accidentally led to all passes clocking in at 0ns. Swap the order of arguments to get true timing information. --- cranelift/codegen/src/timing.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cranelift/codegen/src/timing.rs b/cranelift/codegen/src/timing.rs index 2d10e97a94d7..c4772c92b0e1 100644 --- a/cranelift/codegen/src/timing.rs +++ b/cranelift/codegen/src/timing.rs @@ -291,7 +291,7 @@ mod enabled { impl Drop for DefaultTimingToken { fn drop(&mut self) { let now = monotonic_instant(); - let duration = self.start.duration_since(now); + let duration = now.duration_since(self.start); log::debug!("timing: Ending {}: {}ms", self.pass, duration.as_millis()); let old_cur = CURRENT_PASS.with(|p| p.replace(self.prev)); assert_eq!(self.pass, old_cur, "Timing tokens dropped out of order");