Leave the scope at the top of the stack and increment its scope by the given duration
(&mut self, duration: Duration)
| 159 | |
| 160 | /// Leave the scope at the top of the stack and increment its scope by the given duration |
| 161 | fn leave(&mut self, duration: Duration) { |
| 162 | if let Some(id) = self.scope_stack.pop() { |
| 163 | if let Some(scope) = self.scopes.get_mut(&id) { |
| 164 | scope.num_calls += 1; |
| 165 | scope.duration_sum += duration; |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | fn new_id(&self, name: &'static str, parent: Option<&ScopeId>) -> ScopeId { |
| 171 | ScopeId { |