質問

The return type of SDL's time function SDL_GetTicks() is Uint32 which is a typedef uint32_t Uint32. The function gives the milliseconds after the start of the SDL application.

Now, 32 bits of unsigned integer holding milliseconds are roughly 50 days. Assuming I write an application (e.g. a game server that runs 24/7) that uses this function to calculate run speed, what will happen after 50 days of runtime when the 32 bit unsigned integer is full?

役に立ちましたか?

解決

It overflows.

According to this website and some other resources, the value will start over every 49.7 days.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top