As far as I understand the yield to use here is the same as sleep(0.00...01) would be. It tells the scheduler that you do not need to do more work at the moment.
The platform is capable of dividing the time, but it cannot know (without you telling it), when it is the best to interrupt a thread.
So without yielding the process/thread, the scheduler might make your thread go through 29 times the loop immidiately, which is redundant, since there might be no new input. And then you will not get another round for a whole second. It is better to yield instead of doing redundant work, so you can get back to work that much sooner when it will matter.
The other reason is that the scheduler has good chances of pausing your loop when you are in the middle, which means rendering will be late. Yielding at the end means that, if the scheduler intends more time for your thread/process than what one looping takes on average, then you are less likely to get the thread/process paused in the middle of the loop.