pub struct PhysicsProfiler {
pub stats: StepStats,
pub frame_count: u64,
pub enabled: bool,
/* private fields */
}Expand description
Physics profiler: collects timing and statistics
Fields§
§stats: StepStatsCurrent frame stats
frame_count: u64Frame counter
enabled: boolWhether profiling is enabled
Implementations§
Source§impl PhysicsProfiler
impl PhysicsProfiler
Sourcepub fn begin_frame(&mut self)
pub fn begin_frame(&mut self)
Begin a new frame (reset per-frame stats)
Sourcepub fn get(&self, stage: usize) -> Option<&ProfileEntry>
pub fn get(&self, stage: usize) -> Option<&ProfileEntry>
Get a profile entry by stage index
Sourcepub fn last_ticks(&self, stage: usize) -> u64
pub fn last_ticks(&self, stage: usize) -> u64
Get last frame’s ticks for a stage
Sourcepub fn average_ticks(&self, stage: usize) -> u64
pub fn average_ticks(&self, stage: usize) -> u64
Get average ticks for a stage. After the total has saturated at
u64::MAX this is u64::MAX / count, a lower bound on the true average.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PhysicsProfiler
impl RefUnwindSafe for PhysicsProfiler
impl Send for PhysicsProfiler
impl Sync for PhysicsProfiler
impl Unpin for PhysicsProfiler
impl UnsafeUnpin for PhysicsProfiler
impl UnwindSafe for PhysicsProfiler
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more