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

Method push

native/shared/src/profiler.rs:83–88  ·  view source on GitHub ↗
(&mut self, cpu: f64, gpu: Option<f64>)

Source from the content-addressed store, hash-verified

81 Self { cpu: [0.0; ROLLING_FRAMES], gpu: [0.0; ROLLING_FRAMES], has_gpu: false, idx: 0, filled: 0 }
82 }
83 fn push(&mut self, cpu: f64, gpu: Option<f64>) {
84 self.cpu[self.idx] = cpu;
85 if let Some(g) = gpu { self.gpu[self.idx] = g; self.has_gpu = true; }
86 self.idx = (self.idx + 1) % ROLLING_FRAMES;
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();

Callers 6

endMethod · 0.45
reserve_gpu_pairMethod · 0.45
frame_endMethod · 0.45
frame_end_cpuMethod · 0.45
frame_historyMethod · 0.45
fake_frameFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected