Download

Why does FPlatformTime::Cycles() return a 32-bit integer?

I’d like to use FPlatformTime::Cycles() for measuring game-play time, but since it returns a mere 32-bit integer, the timing result will wrap around within half an hour. Since the average game takes longer than a half hour, use of FPlatformTime::Cycles() (other than as random seed) is awkward, since it requires me to detect and handle wrap-around. Use of FPlatformTime::Seconds() is simpler yet more expensive, since it involves some double-precision arithmetic. The underlying counters on different OS-es return 64-bit integers. So, this begs the question: Why doesn’t FPlatformTime::Cycles() return a 64-bit integer?