sdl.timer

SDL Timer

Members

Aliases

SDL_NSTimerCallback
alias SDL_NSTimerCallback = ulong function(void* userdata, SDL_TimerID timerID, ulong interval)

Function prototype for the nanosecond timer callback function.

SDL_TimerCallback
alias SDL_TimerCallback = uint function(void* userdata, SDL_TimerID timerID, uint interval)

Function prototype for the millisecond timer callback function.

SDL_TimerID
alias SDL_TimerID = uint

Definition of the timer ID type.

Functions

SDL_AddTimer
SDL_TimerID SDL_AddTimer(uint interval, SDL_TimerCallback callback, void* userdata)

Call a callback function at a future time.

SDL_AddTimerNS
SDL_TimerID SDL_AddTimerNS(ulong interval, SDL_NSTimerCallback callback, void* userdata)

Call a callback function at a future time.

SDL_Delay
void SDL_Delay(uint ms)

Wait a specified number of milliseconds before returning.

SDL_DelayNS
void SDL_DelayNS(ulong ns)

Wait a specified number of nanoseconds before returning.

SDL_DelayPrecise
void SDL_DelayPrecise(ulong ns)

Wait a specified number of nanoseconds before returning.

SDL_GetPerformanceCounter
ulong SDL_GetPerformanceCounter()

Get the current value of the high resolution counter.

SDL_GetPerformanceFrequency
ulong SDL_GetPerformanceFrequency()

Get the count per second of the high resolution counter.

SDL_GetTicks
ulong SDL_GetTicks()

Get the number of milliseconds that have elapsed since the SDL library initialization.

SDL_GetTicksNS
ulong SDL_GetTicksNS()

Get the number of nanoseconds since SDL library initialization.

SDL_RemoveTimer
bool SDL_RemoveTimer(SDL_TimerID id)

Remove a timer created with SDL_AddTimer().

Manifest constants

SDL_MS_PER_SECOND
enum SDL_MS_PER_SECOND;

Number of milliseconds in a second.

SDL_NS_PER_MS
enum SDL_NS_PER_MS;

Number of nanoseconds in a millisecond.

SDL_NS_PER_SECOND
enum SDL_NS_PER_SECOND;

Number of nanoseconds in a second.

SDL_NS_PER_US
enum SDL_NS_PER_US;

Number of nanoseconds in a microsecond.

SDL_US_PER_SECOND
enum SDL_US_PER_SECOND;

Number of microseconds in a second.

See Also

Meta

License

Subject to the terms of the Zlib License, as written in the LICENSE file.

Authors

Luna Nielsen