Get the number of milliseconds since SDL library initialization.
Defined in <SDL3/SDL_timer.h>
Returns an unsigned 64-bit value representing the number of milliseconds since the SDL library initialized.
This function is available since SDL 3.0.0.
int variable;
SDL_bool quit = SDL_FALSE;
unsigned int lastTime = 0, currentTime;
while (!quit) {
// do stuff
// ...
// Print a report once per second
currentTime = SDL_GetTicks();
if (currentTime > lastTime + 1000) {
printf("Report: %d\n", variable);
lastTime = currentTime;
}
}