MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / enter_with_id

Method enter_with_id

splashsurf_lib/src/profiling.rs:148–158  ·  view source on GitHub ↗
(&mut self, name: &'static str, id: ScopeId)

Source from the content-addressed store, hash-verified

146 }
147
148 fn enter_with_id(&mut self, name: &'static str, id: ScopeId) -> (Guard, ScopeId) {
149 self.scopes.entry(id).or_insert_with(|| Scope::new(name));
150
151 // Insert as root, even it has a manually assigned parent to prevent child scopes from ending up as roots themselves
152 if self.scope_stack.is_empty() {
153 self.roots.insert(id);
154 }
155
156 self.scope_stack.push(id);
157 (Guard::new(), id)
158 }
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) {

Callers 2

enterMethod · 0.80
enter_with_parentMethod · 0.80

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected