(&mut self)
| 290 | /// Dropping a timing token indicated the end of the pass. |
| 291 | impl Drop for DefaultTimingToken { |
| 292 | fn drop(&mut self) { |
| 293 | let now = monotonic_instant(); |
| 294 | let duration = now.duration_since(self.start); |
| 295 | log::debug!("timing: Ending {}: {}ms", self.pass, duration.as_millis()); |
| 296 | let old_cur = CURRENT_PASS.with(|p| p.replace(self.prev)); |
| 297 | assert_eq!(self.pass, old_cur, "Timing tokens dropped out of order"); |
| 298 | PASS_TIME.with(|rc| { |
| 299 | let mut table = rc.borrow_mut(); |
| 300 | table.pass[self.pass.idx()].total += duration; |
| 301 | if let Some(parent) = table.pass.get_mut(self.prev.idx()) { |
| 302 | parent.child += duration; |
| 303 | } |
| 304 | }) |
| 305 | } |
| 306 | } |
| 307 | } |
| 308 |
nothing calls this directly
no test coverage detected