LocalTime and DeltaTime

MEC keeps track of the local time inside each segment and keeps the LocalTime and DeltaTime variables updated. The default Time class in Unity will work fine most of the time, but won’t work right in the SlowUpdate, and it is completly unavailable in the EditorUpdate and EditorSlowUpdate segments.

Unity’s Time class returns time as a float value. Floats store their values inside 4 bytes in a rather complicated format in which the decimal point can float around inside the number. This means that the larger the number you have to the left of the decimal point the more you have to round the number to the right. Unity’s time counts the number of seconds since your app started, so the more seconds that pass the less precision you get with the fractions of a second. After about 2 hours of running, most Unity apps will start to show things jumping around on the screen a little because of this rounding. After about 8 hours of running the app can become unplayable.

This is why MEC keeps track of time as a double rather than a float. Doubles use 8 bytes to store the value which means that it takes 32 times as long to get to the same level of rounding error that a float does. For really long running apps, MEC provides the function ResetTimeCount, which will return the counters to zero (only for the Update, FixedUpdate, and LateUpdate segments though).