1import time
2
3start_time = time.time()
4x = 1 # displays the frame rate every 1 second
5counter = 0
6while True:
7
8 ########################
9 # your fancy code here #
10 ########################
11
12 counter+=1
13 if (time.time() - start_time) > x :
14 print("FPS: ", counter / (time.time() - start_time))
15 counter = 0
16 start_time = time.time()
17