Struct sdl2::TimerSubsystem [] [src]

pub struct TimerSubsystem {
    // some fields omitted
}

Methods

impl TimerSubsystem
[src]

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

fn ticks(&mut self) -> u32

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.

fn delay(&mut self, ms: u32)

Sleeps the current thread for the specified amount of milliseconds.

It's recommended that you use std::thread::sleep_ms() instead.

fn performance_counter(&self) -> u64

fn performance_frequency(&self) -> u64

impl TimerSubsystem
[src]

fn clone(&mut self) -> TimerSubsystem

fn sdl(&mut self) -> Sdl

Obtain an SDL context.

Trait Implementations

impl Sync for TimerSubsystem
[src]