[−][src]Struct sdl2::TimerSubsystem
Methods
impl TimerSubsystem
[src]
#[must_use = "if unused the Timer will be dropped immediately"]
pub fn add_timer<'b, 'c>(
&'b self,
delay: u32,
callback: TimerCallback<'c>
) -> Timer<'b, 'c>
[src]
#[must_use = "if unused the Timer will be dropped immediately"]
pub fn add_timer<'b, 'c>(&'b self,
delay: u32,
callback: TimerCallback<'c>
) -> Timer<'b, 'c>
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
pub fn ticks(&mut self) -> u32
[src]
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
.
pub fn delay(&mut self, ms: u32)
[src]
Sleeps the current thread for the specified amount of milliseconds.
It's recommended that you use std::thread::sleep()
instead.
pub fn performance_counter(&self) -> u64
[src]
pub fn performance_frequency(&self) -> u64
[src]
impl TimerSubsystem
[src]
Trait Implementations
impl Sync for TimerSubsystem
[src]
Auto Trait Implementations
impl !Send for TimerSubsystem
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,