yield WaitForSeconds() -- exact time?

If I do:

function Start()
{
   while (true)
   {
      Debug.Log(Time.time);
      yield WaitForSeconds(1);
   }
}

I don 't get one second intervals printing to the debug log. I get 1 second plus some random variations of Time.deltaTime, such as:

0.0013
1.0145
2.0249
3.0301

But if I pause execution and step through the program one frame at a time I do get exactly one second intervals printing to the console.

Is there any way I can ensure exactly one second intervals with yield WaitForSeconds(1) when executing the program in real time? Or is there some other way to do this?

Thanks for any advice with this.

Mitch

there is no way to get exactly 1s as it is checked at the same interval as update so if your framerate is locked or fluctuates or if you toy with the timescale, the coroutine will fluctuate accordingly

The difference between 3, and 3.03 is so small, I doubt a human will notice.

If you want the function to return a sharp second, just apply Mathf.Round to the returned value.

Thanks, Dreamora. That helps.