Add some debug logging for timing in module compiles (#3417)
* Add some debug logging for timing in module compiles This is sometimes helpful when debugging slow compiles from fuzz bugs or similar. * Fix total duration calculation to not double-count
This commit is contained in:
@@ -130,6 +130,13 @@ mod details {
|
||||
pass: [PassTime; NUM_PASSES],
|
||||
}
|
||||
|
||||
impl PassTimes {
|
||||
/// Returns the total amount of time taken by all the passes measured.
|
||||
pub fn total(&self) -> Duration {
|
||||
self.pass.iter().map(|p| p.total - p.child).sum()
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for PassTimes {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user