Let’s say you were going to hold a competition and you needed to time people as accurately as possible (to the millisecond if possible).
What way is best across all platforms?
I just read system.getTimer is not necessarily accurate to the millisecond on Android devices.
To me, from a mathematician’s standpoint the best way to get as accurate is as follows
Step A: Get the starting time (down to the millisecond) (I thought using system.getTimer())
Step B: Every millisecond or 2 get new time. Subtract starting time from this time and that is elapsed time - show this in a window.
Step C: Keep repeating Step B until they are finished.
Step D: Get stop time (down to the millisecond). Subtract starting time from this value - that will give us the exact run time.
Step B and C is just for show…
So is getTimer the best way? Just how imprecise can it get in Android?
Or to be 100% fair should I just measure time to the tenth of a second and use getTimer?
Thanks!