SDL_GetTicks function
SDL_GetTicks -- Gets the number of milliseconds since SDL library initialization.
Syntax
Uint32 SDL_GetTicks(void)
Description
Returns the number of milliseconds since SDL library initialization. This value wraps around if the program runs for more than 49.7 days.
Parameter
nothing
Return value
An unsigned 32 bit integer number
- The returned value represents the number of milliseconds since SDL library initialization
See also
Example
This function can be used to build a double click handling routine. In fact, in the SDL event subsystem, there's currently no such mouse event. One solution consists of calculating the interval between two mouse clicks by saving the values returned by SDL_GetTicks. Then if the difference between two values returned by SDL_GetTicks is inside a predefined threshold, the application can fire a software double click event.
Requirements
Header |
SDL.h |
Version |
1.2.13 |
Shared object |
libSDL.so |
DLL |
SDL.dll |
