|
how much is the precision of time.time? how many times a second does unity update it? what source of time unity uses for it's timing? high performance CPU time. multimedia timer? that old assembly instruction? i know that only unity engineers can answer this question.
(comments are locked)
|
|
As the documentation states:
So, depending on whether you are in FixedUpdate or Update, Time.time is updated as often as the screen updates, or in Time.fixedDeltaTime increments. If you need more precision, use Time.realtimeSinceStartup. That function is based on the Microseconds() function on OS X, and on the QueryPerformanceCounter() function on windows. so can i use time.time in a coroutine to see if i spend much time then wait for the next frame?
Jan 23 '10 at 10:13 AM
Ashkan_gc
yes, since coroutines will only be called once per frame/ fixed frame, Time.time will work as expected there. But why don't you just use "yield return new WaitForSeconds(x);"?
Jan 23 '10 at 02:46 PM
jonas echterhoff ♦♦
i want to see how much time past since start of current frame. can use time.time for it? does it return 0 before next Update/FixedUpdate?
Jan 24 '10 at 04:58 AM
Ashkan_gc
You should use start = Time.realtimeSinceStartup at the beginning of your iteration, and then check Time.realtimeSinceStartup-start at any time to see how much time has passed.
Jan 24 '10 at 02:16 PM
jonas echterhoff ♦♦
(comments are locked)
|
