- Home /
Question by
DrummerB · Jun 26, 2018 at 03:21 PM ·
performancetimeframerateframes per secondperformance metrics
How to calculate an accurate frame duration?
How can I measure how long it takes to update and render a full frame excluding idle time?
Time.deltaTime returns the time between frames including idle time. For instance, if I have a super simple scene that takes 1ms to update and render, deltaTime will still be 16ms if the game is locked to 60 FPS. Using the stats window or profiler is not possible, because I need to know this information at runtime in a standalone build.
Reason: I have a long running task that has to be on the main thread. To avoid freezing the game I do a little bit of the task each frame. I would like to adjust the amount of work done each frame depending on how much time is left after each frame.
Comment