Struct game_time::clock::GameTime
[−]
[src]
pub struct GameTime { /* fields omitted */ }
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]
fn total_game_time(&self) -> Duration
The game time at the time of creation of this GameTime
object.
fn total_wall_time(&self) -> DateTime<Local>
The wall time at the time of creation of this GameTime
object.
fn elapsed_game_time(&self) -> FloatDuration
The amount of game time that passed since the previous frame.
fn elapsed_wall_time(&self) -> FloatDuration
The amount of wall time that passed since the previous frame.
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.
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.
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 Debug for GameTime
[src]
impl Clone for GameTime
[src]
fn clone(&self) -> GameTime
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more