Get the number of milliseconds since SDL library initialization.
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) {
printf("Report: %d\n", variable);
lastTime = currentTime;
}
}