Time.time slower than real time on one computer

So I made a game for ludum dare where “note” objects spawn over time, in sync with a playing background music. It is critical that these notes are in sync with the music, so I base the spawning on Time.time.

This works fine, except for on one computer where notes are spawning too slow in relation to the music. After making experiments I found the following:

  • Music playback speed is correct on all computers (proven by recording sound with audacity)
  • Time.time counter is too slow, i.e. when real stop watch shows one minute, Time.time shows around 58 seconds. The error increases over time.
  • The same issue arises from summing up Time.deltaTime and also by using Time.fixedTime.
  • I have only seen the problem on one computer.
  • Problem is at least present in unity 4.2 and 4.3
  • Problem appears from within editor, from PC build and from web build (haven’t tried any other platforms).
  • Time scale is correctly set to 1.

Tell me if I need to give you specs of my computer. So the problem seems to be that the internal time counter in unity is increasing too slow. Any ideas on what could be wrong?

Edit: My small game can be found at Play Polytonia, a free online game on Kongregate if you want to see if you get the problem.

Hi,

Time.time returns the time at which the current frame started, and is not accurate as you found out. For precise musical timing, use AudioSettings.dspTime and play AudioClips with audio.PlayScheduled( double time ).