Wait is an implicit return from your function right then and there, so if for example the callee expects to see the side effects from its call, you need to defer the wait until after the side effects took place. Put in a different way that could mean that you have an action that moves an entity, but that will only ever happen after the first frame the action is called when putting the wait first.

Another example, just to show that waits don't necessarily are right at either end of the while, you might have a loop that in the first frame takes some data and pre-processes it, then comes a wait, and then it acts upon the data, followed by another wait and then it all starts again. So each frame it either pre-processes data or it acts based on the data.

Simply put, where it rights really does depend on what you do.
Edit: Looks like firo was faster

Last edited by WretchedSid; 04/28/15 20:53.

Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com