Calculates framerate instead of calling sleep