Get the number of milliseconds since SDL library initialization.
void); Uint64 SDL_GetTicks(
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.
unsigned int lastTime = 0, currentTime;
while (!quit) {
// do stuff
// ...
// Print a report once per second
currentTime = SDL_GetTicks();if (currentTime > lastTime + 1000) {
"Report: %d\n", variable);
printf(
lastTime = currentTime;
} }