Quick answer: Pygame game eating 100% CPU even on the menu? Clock.tick(0) doesn't sleep - pass a frame rate cap or use Clock.tick_busy_loop for precise timing.
Game uses Clock.tick() with no argument for the menu. CPU goes to 100% and the laptop fan screams.
Pass a frame cap
clock.tick(60)Yields to the OS until enough time has passed. CPU drops to single-digit percentages.
Use tick_busy_loop for precision
Spin-wait for accurate timing in physics-heavy frames. Costs CPU; gains precision. Reserve for actual gameplay, not menus.
Sleep on menu
pygame.time.wait(10)For static menus, an explicit sleep is cheaper than tick(). Updates happen on input only.
“Pygame Clock.tick without an argument means 'as fast as possible' - which is what 100% CPU looks like.”
Pick a per-screen frame rate target. Gameplay 60, menus 30, paused 15. Battery savings on laptops are dramatic.