[−][src]Struct game_time::clock::GameTime
A specific point of time in a simulation.
GameTime
knows both the wall time and game time of the simulation at a
fixed time. A GameTime
object is usually created by calling
tick
on a GameClock
object.
Methods
impl GameTime
[src]
impl GameTime
pub fn total_game_time(&self) -> FloatDuration
[src]
pub fn total_game_time(&self) -> FloatDuration
The game time at the time of creation of this GameTime
object.
pub fn total_wall_time(&self) -> FloatDuration
[src]
pub fn total_wall_time(&self) -> FloatDuration
The wall time elapsed since the start of the simulation.
pub fn frame_start_time(&self) -> DateTime<Local>
[src]
pub fn frame_start_time(&self) -> DateTime<Local>
The wall time at the time of creation of this GameTime
object.
pub fn elapsed_game_time(&self) -> FloatDuration
[src]
pub fn elapsed_game_time(&self) -> FloatDuration
The amount of game time that passed since the previous frame.
pub fn elapsed_wall_time(&self) -> FloatDuration
[src]
pub fn elapsed_wall_time(&self) -> FloatDuration
The amount of wall time that passed since the previous frame.
pub fn elapsed_time_since_frame_start(&self) -> FloatDuration
[src]
pub fn elapsed_time_since_frame_start(&self) -> FloatDuration
The amount of elapsed wall time since the start of the current frame.
This value is computed from the current instant when called, based on the frame start time. This can be used for intra-frame profiling.
pub fn frame_number(&self) -> u64
[src]
pub fn frame_number(&self) -> u64
The index of the current frame.
This value increases by 1 for each frame created, and represents the total number of frames executed in the simulation.
pub fn instantaneous_frame_rate(&self) -> f64
[src]
pub fn instantaneous_frame_rate(&self) -> f64
Return the instantaneous frame rate between the last and current frames.
The "instantaneous" frame rate is computed from the last frame's elapsed time, and takes no previous frames into account.
For a more stable frame rate, use a
FrameCount
object.
Trait Implementations
impl Clone for GameTime
[src]
impl Clone for GameTime
fn clone(&self) -> GameTime
[src]
fn clone(&self) -> GameTime
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for GameTime
[src]
impl Debug for GameTime
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T, U> IntoDuration for T where
U: FromDuration<T>,
[src]
impl<T, U> IntoDuration for T where
U: FromDuration<T>,
type Error = <U as FromDuration<T>>::Error
fn into_duration(self) -> Result<U, <U as FromDuration<T>>::Error>
[src]
fn into_duration(self) -> Result<U, <U as FromDuration<T>>::Error>