MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / avg_cpu

Method avg_cpu

native/shared/src/profiler.rs:89–93  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

87 self.filled = (self.filled + 1).min(ROLLING_FRAMES);
88 }
89 fn avg_cpu(&self) -> f64 {
90 if self.filled == 0 { return 0.0; }
91 let sum: f64 = self.cpu.iter().take(self.filled).sum();
92 sum / self.filled as f64
93 }
94 fn avg_gpu(&self) -> Option<f64> {
95 if !self.has_gpu || self.filled == 0 { return None; }
96 let sum: f64 = self.gpu.iter().take(self.filled).sum();

Callers 3

summaryMethod · 0.80
avg_frame_cpu_usMethod · 0.80
snapshotMethod · 0.80

Calls 1

iterMethod · 0.80

Tested by

no test coverage detected