Isn't Time.time supposed to measure time in real seconds? I noticed that while looping a one-second sound during 10 seconds (as measured with Time.time) the sound plays 17 times instead of 10. I did this both in the editor and as a standalone (on windows). What gives? Is there any way to improve the timing of unity?
When doing this I have a pretty high framerate (~3ms per frame in the editor). Can't you trust the time functions at high framerates?
Using a sound loop isn't really a good way to measure time, but in any case, Time.time is affected by the timescale. With the timescale set to 1.0, use this script and a stopwatch and see if they match:
function Update () {
Debug.Log (Time.time);
}
(The answer is yes they will match, although note that the stats display is not the framerate you're actually getting. Use this for actual frames per second.)
Did you make sure that the timescale is 1.0?
– Eric5h5