Struct gameloop_timing::looptimer::LoopTimer[][src]

pub struct LoopTimer {
    pub start: Instant,
    pub end: Instant,
    pub time: Duration,
    pub target: Duration,
    pub count: u32,
}
Expand description

Wraps the variables necessary to keep track of loop timings.

Fields

start: Instant

The last start of the loop.

end: Instant

The last end of the loop.

time: Duration

The last time/duration of the loop.

target: Duration

The intended time/duration of the loop.

count: u32

How many iterations have been done.

Implementations

Creates a new looptimer with the given target loop duration.

Creates a new looptimer with the given target loop duration and a starting instant.

Resets the loop-counter.

Begins the loop measurement.

Finishes the loop measurement.

Returns the length of the last loop iteration, in nanoseconds.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.