The value you are seeing should be the number of milliseconds that have
elapsed from start to finish.
As the wiki page for SDL_GetTicks() [1] states,
Use this function to get the number of milliseconds since the SDL
library initialization.
Any time that you make that call, you are getting back the number of
milliseconds since SDL initialization (this value can become quite
large if the program is run for long enough).
the return type of SDL_GetTicks is an integer, not a double. Treating integers as doubles without performing a conversion is usually (unless you’re intentionally doing something highly irregular) wrong.------------------------
Nate Fries
the return type of SDL_GetTicks is an integer, not a double. Treating integers as doubles without performing a conversion is usually (unless you’re intentionally doing something highly irregular) wrong.
C/C++ do implicit conversions of integer types to double. IIRC double can represent all whole numbers up to 2^53 which is quite a long time even in milliseconds so I doubt that is a problem here
unless of course OP is doing something silly like doing a reinterpret_cast he should be fine.
That said, he almost certainly doesn’t have cause to use a double here and should use the appropriate integer type returned from SDL_GetTicks.