Struct sdl2::TimerSubsystem

source ·
pub struct TimerSubsystem { /* private fields */ }

Implementations

Constructs a new timer using the boxed closure callback.

The timer is started immediately, it will be cancelled either:

  • when the timer is dropped
  • or when the callback returns a non-positive continuation interval

Gets the number of milliseconds elapsed since the timer subsystem was initialized.

It’s recommended that you use another library for timekeeping, such as time.

Sleeps the current thread for the specified amount of milliseconds.

It’s recommended that you use std::thread::sleep() instead.

Obtain an SDL context.

Trait Implementations

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.