Can WaitForSeconds run multiple times per frame?
Pretty simple question. Take this example:
Protected IEnumerator myCoroutine () {
while (true) {
doStuff ();
yield return new WaitForSeconds (tinyNumber);
}
}
If 'tinyNumber' is sufficiently tiny, and the framerate is low, could 'myCoroutine' be resumed multiple timed per frame?
In other words, do coroutines function like 'FixedUpdate' or should it more properly be called 'WaitForAtLeastSeconds ()'?
Answer by doublemax · Sep 09, 2016 at 11:32 PM
I'd say that WaitForSeconds() waits at least one frame.
https://docs.unity3d.com/uploads/Main/monobehaviour_flowchart.svg
Or, from the WaitForSeconds page "WaitForSeconds starts waiting at the end of the current frame." and "resume on the first frame after 't' seconds has passed" gives the impression it will run at most once/frame.
Your answer
Follow this Question
Related Questions
FixedUpdate in Coroutine 1 Answer
Coroutine not working as expected 1 Answer
Persistent Timers in Couroutines 0 Answers
Issues with video player coroutine 2 Answers
Co-routine a recursion help 0 Answers