Best Practice for "Game Time" measurements

In various places in the game it can be useful to measure elapsed time (one example may be the time in between “Touch Start” and “Touch End” in a touch interface, for example).

I’ve always used the “Get Time Seconds” node for this:

But it occurred to me: What if the game is playing for a (very) long time? Wouldn’t floating point issues start to occur when, say, the game has run for a day or so?

Any ideas on how to improve this? If I need to measure like 0.1 seconds, will that will work ok? Or am I just creating a hypothetical problem here?

My Google-Fu is telling me a double is good enough for 285 million years were we to store milliseconds accurately.

Excellent. One worry less :slight_smile:

1 Like