- Home /
Function only use "leftover" time?
Hello, i was wondering if there is any way to tell a function to only use "leftover" time from a frame. I have a heavy function that uses many seconds to finish, so every time i call it the game will freeze until its done. I have experimented with yielding in the function, and it kinda works, but its hard to figure out how much to yield. Too little yielding, and the frame rate suffers, too much yielding and the function takes forever to finish. So, are there any built in functionality that lets a function only use "leftover" time?
Alternatively, if anyone have a good algorithm for doing this with yielding, please share it with me :)
Answer by Fattie · May 05, 2013 at 03:22 PM
yes, there's recent a massive, expert explanation by WHydoidoit, right here
http://answers.unity3d.com/questions/447544/pausing-processing-relative-to-frame-rate-unity.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613101548im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity performance issues in my scene. 1 Answer
Very strange geometry issue, causing huge drops in frame rate 3 Answers
Low Application.targetFrameRate slows Silverlight/Browser too 0 Answers
I have performance lag after my game has been compiled. 1 Answer
Stuttering / performance issue with certain JS scripts 0 Answers