began to create a game in Pygame. I decided to add the FPS counter, but nothing happened to me. Nowhere in Google, I did not find a response.
Tell me how to do it?
p.s. I well, a very novice programmer. If my question seemed to you stupid, this is normal.
Answer # 1
Try this way:
Import Time While True: start_time= time.time () # Start Time of the Loop Print ("FPS:", 1.0 /(time.time () -start_time))
Import Time start_time= time.time () X= 1 # Displays The Frame Rate Every 1 Second Counter= 0. While True: Counter += 1 if (time.time () -start_time) > x: Print ("FPS:", Counter /(Time.time () -start_time)) Counter= 0. start_time= time.time ()
- python : Pygame Ant Langton does not work on classes
- Pouring for drawing in Python
- python : Text color change on pygame
- python : Flappy Bird on Pygame
- python : I can not understand what a mistake in my code
- python : How to count the time in Pygame?
- python : Parallel execution of the stopwatch on Pygame
- python : How to remove the frames in Pygame?
- python : How to make a goggle system in the game?