Search Unity

When is time.deltaTime not "The completion time in seconds since the last frame."

Discussion in 'Documentation' started by ThySpektre, May 16, 2019.

  1. ThySpektre

    ThySpektre

    Joined:
    Mar 15, 2016
    Posts:
    362
    This started from a thread about keeping networked clients in sync.

    When is time.deltaTime NOT "The completion time in seconds since the last frame."

    It was pointed out time.deltaTime is not the time since the last frame if Time.timeScale <> 1.

    What happens to Time.deltaTime if long execution time code is placed in the Update() loop?
    What about if the system becomes busy with non-script related delays, such as filesystem reads and writes, or other non-game processes using up cycles, etc.

    In my game, I am seeing the cumulative time.DeltaTime become inaccurate on the scale of 2-3 seconds over a 4 minute period. It seems to happen when the game needs to hit the hard drive for saving some data.

    Is there any in depth write up for how Time.deltaTime is derived for Windows based systems? Or more information on when time.deltaTime does not equal the value stated in the documentation here?

    https://docs.unity3d.com/ScriptReference/Time-deltaTime.html
     
    Last edited: May 16, 2019