5 ms·
The problem wasn't in the way the time was stored (integer representing tenths of seconds); it was in the conversion to float for the calculations being done. A
by kstenerud 3y ago
The problem wasn't in the way the time was stored (integer representing tenths of seconds); it was in the conversion to float for the calculations being done. A 1/1000000 error margin is fine for small numbers (up to 30,000 seconds), but not for big ones (100,000 seconds) where being even a tenth of a second off causes the calculation to become unreliable.
- greesil 3y agoRule #2 is when calculating duration is to keep the timestamps as long long. If for some reason you need to convert the duration to float, check the duration first and/or just use double precision.