0

I'm running a Pygame simulation with Python 3 on OSX. For some reason I cannot exceed 60 fps, but ideally I would be able to run it very high to run multiple trials in a short amount of time.

Im using clock = pygame.time.Clock() at the top of my main, and then:

while True:
    clock.tick(1000)
    print(clock.get_fps())

Any suggestions for how I could get my clock to run faster? Thanks.

Blckknght
  • 100,903
  • 11
  • 120
  • 169
muZero
  • 948
  • 9
  • 22

1 Answers1

0

From http://pygame.org/docs/ref/time.html#pygame.time.Clock.tick

Note that this function uses SDL_Delay function which is not accurate on every platform, but does not use much CPU. Use tick_busy_loop if you want an accurate timer, and don’t mind chewing CPU.

tick_busy_loop reference: http://pygame.org/docs/ref/time.html#pygame.time.Clock.tick_busy_loop

Blake O'Hare
  • 1,863
  • 12
  • 16