pub struct PerformanceMonitor { /* private fields */ }Expand description
Rolling performance monitor for animation workloads.
Implementations§
Source§impl PerformanceMonitor
impl PerformanceMonitor
Sourcepub fn record_frame(&mut self, dt: f32)
pub fn record_frame(&mut self, dt: f32)
Record a frame delta in seconds.
Sourcepub fn record_profile(&mut self, profile: &DriverFrameProfile)
pub fn record_profile(&mut self, profile: &DriverFrameProfile)
Record driver profile data.
Sourcepub fn avg_frame_time_ms(&self) -> f32
pub fn avg_frame_time_ms(&self) -> f32
Average frame time in milliseconds.
Sourcepub fn max_frame_time_ms(&self) -> f32
pub fn max_frame_time_ms(&self) -> f32
Maximum frame time in milliseconds.
Sourcepub fn frame_budget_usage(&self, target_fps: f32) -> f32
pub fn frame_budget_usage(&self, target_fps: f32) -> f32
Frame budget usage where 1.0 means 100% of budget.
Sourcepub fn exceeds_budget(&self, target_fps: f32) -> bool
pub fn exceeds_budget(&self, target_fps: f32) -> bool
Whether the rolling average exceeds the target frame budget.
Sourcepub fn animation_costs(&self) -> &[AnimationCostRecord]
pub fn animation_costs(&self) -> &[AnimationCostRecord]
Latest per-animation costs.
Sourcepub fn active_animation_count(&self) -> usize
pub fn active_animation_count(&self) -> usize
Latest active animation count.
Trait Implementations§
Source§impl Clone for PerformanceMonitor
impl Clone for PerformanceMonitor
Source§fn clone(&self) -> PerformanceMonitor
fn clone(&self) -> PerformanceMonitor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PerformanceMonitor
impl Debug for PerformanceMonitor
Source§impl Default for PerformanceMonitor
impl Default for PerformanceMonitor
Source§impl PartialEq for PerformanceMonitor
impl PartialEq for PerformanceMonitor
impl StructuralPartialEq for PerformanceMonitor
Auto Trait Implementations§
impl Freeze for PerformanceMonitor
impl RefUnwindSafe for PerformanceMonitor
impl Send for PerformanceMonitor
impl Sync for PerformanceMonitor
impl Unpin for PerformanceMonitor
impl UnsafeUnpin for PerformanceMonitor
impl UnwindSafe for PerformanceMonitor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more