title: Control the speed of a loop
body: <p>I'm currently reading physics in the university, and im learning python as a little hobby.</p>
  
  <p>To practise both at the same time, i figured I'll write a little "physics engine" that calculates the movement of an object based on x,y and z coordinates. Im only gonna return the movement in text (at least for now!) but i want the position updates to be real-time.</p>
  
  <p>To do that i need to update the position of an object, lets say a hundred times a second, and print it back to the screen. So every 10 ms the program prints the current position.</p>
  
  <p>So if the execution of the calculations take 2 ms, then the loop must wait 8ms before it prints and recalculate for the next position.</p>
  
  <p>Whats the best way of constructing a loop like that, and is 100 times a second a fair frequency or would you go slower, like 25 times/sec?</p>