How to animate a loop so it doesn't freeze

Something interesting and unobvious about asynchronous actions too is that they will always resolve (= run the code that comes after it) not when it has finished its job, but at the start of the next frame after it has!
Even if 0.1 second elapses, and the condition of the wait has thus been met, the code after will only be called at the start of the next frame.

1 Like