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

Method frame_history

native/shared/src/profiler.rs:303–313  ·  view source on GitHub ↗

Phase 8 — frame-history snapshot for the overlay's bar chart. Returns `(cpu_us, gpu_us)` pairs in chronological order, oldest first, exactly `ROLLING_FRAMES.min(filled)` entries long.

(&self)

Source from the content-addressed store, hash-verified

301 /// Returns `(cpu_us, gpu_us)` pairs in chronological order, oldest
302 /// first, exactly `ROLLING_FRAMES.min(filled)` entries long.
303 pub fn frame_history(&self) -> Vec<(f64, f64)> {
304 let n = self.histogram_filled;
305 if n == 0 { return Vec::new(); }
306 let start = if n < ROLLING_FRAMES { 0 } else { self.histogram_idx };
307 let mut out = Vec::with_capacity(n);
308 for i in 0..n {
309 let idx = (start + i) % ROLLING_FRAMES;
310 out.push((self.frame_total_cpu_us[idx], self.frame_total_gpu_us[idx]));
311 }
312 out
313 }
314
315 pub fn summary(&self) -> String {
316 if !self.enabled {

Calls 1

pushMethod · 0.45