Advertisement
Void-voiD

Untitled

May 27th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. import glfw
  2.  
  3.  
  4. glfw.init()
  5. lastTime = glfw.get_time()
  6. nbFrames = 0
  7.  
  8.  
  9. def calc_fps(dt):
  10. global lastTime, nbFrames
  11. currentTime = glfw.get_time()
  12. nbFrames += 1
  13. if currentTime - lastTime >= 1.0:
  14. print(nbFrames)
  15. nbFrames = 0
  16. lastTime += 1.0
  17.  
  18. pyglet.clock.schedule(calc_fps)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement