mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 22:18:33 +00:00
Add a tracing span for run criteria. (#4709)
# Objective Adds a tracing span for run critieria. This change will be invalidated by stageless, but it was a simple change. Fixes #4681. ## Changelog Shows how long a run criteria takes to run when tracing is enabled. ![image](https://user-images.githubusercontent.com/2180432/167517447-93dba7db-8c85-4686-90e0-30e9636f120f.png)
This commit is contained in:
parent
e503a31048
commit
9a54e2bed6
1 changed files with 6 additions and 0 deletions
|
@ -802,6 +802,12 @@ impl Stage for SystemStage {
|
|||
for index in 0..self.run_criteria.len() {
|
||||
let (run_criteria, tail) = self.run_criteria.split_at_mut(index);
|
||||
let mut criteria = &mut tail[0];
|
||||
|
||||
#[cfg(feature = "trace")]
|
||||
let _span =
|
||||
bevy_utils::tracing::info_span!("run criteria", name = &*criteria.name())
|
||||
.entered();
|
||||
|
||||
match &mut criteria.inner {
|
||||
RunCriteriaInner::Single(system) => criteria.should_run = system.run((), world),
|
||||
RunCriteriaInner::Piped {
|
||||
|
|
Loading…
Add table
Reference in a new issue