pub struct FrameClock { /* private fields */ }Expand description
A fixed-rate frame pacer.
Implementations§
Source§impl FrameClock
impl FrameClock
Sourcepub fn new(frames_per_second: u32) -> Self
pub fn new(frames_per_second: u32) -> Self
A clock ticking frames_per_second times a second from now.
Sourcepub fn frame_time(&self) -> Duration
pub fn frame_time(&self) -> Duration
One frame’s duration.
Sourcepub fn wait_for_next_frame(&mut self)
pub fn wait_for_next_frame(&mut self)
Sleep until the next frame deadline and advance. A late frame returns immediately.
Trait Implementations§
Auto Trait Implementations§
impl Forget for FrameClock
impl Freeze for FrameClock
impl Move for FrameClock
impl RefUnwindSafe for FrameClock
impl Send for FrameClock
impl Sync for FrameClock
impl Unpin for FrameClock
impl UnsafeUnpin for FrameClock
impl UnwindSafe for FrameClock
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