Unity's Time is in 32-bit float, that means if it runs over 10000 seconds (about 3 hours) then accuracy is only within 2 decimal places. It will even worse if timeScale is high. I've searched msdn for alternative timers. DateTime and Stopwatch are not so useful because they keep running even when Unity Editor is paused or during breakpoints. There are System.Timers and timer in System.Threading but Windows Store API doesn't support them. Windows Store uses DispatcherTimer but Unity doesn't support it. Are there any high accuracy timers can be used with Unity and at least usable in both Android and Windows Store apps? Thanks!
You can easily make you own, you know? Code (CSharp): public class MyTimer : MonoBehaviour { private double time; public double Time { get { return time; } } private void Update() { time += UnityEngine.Time.unscaledDeltaTime; } }
If you make the private time variable and the public getter static, then you can do MyTimer.Time to get the time.