Delay and return
Listing 5 inserts a five-millisecond delay.
Then it returns control from the moveBall function.
This allows the animation loop shown in Listing 3 to execute another iteration.
The animation loop continues to execute until the user presses the Esc key.
Then the program terminates.