Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import glfw
- glfw.init()
- lastTime = glfw.get_time()
- nbFrames = 0
- def calc_fps(dt):
- global lastTime, nbFrames
- currentTime = glfw.get_time()
- nbFrames += 1
- if currentTime - lastTime >= 1.0:
- print(nbFrames)
- nbFrames = 0
- lastTime += 1.0
- pyglet.clock.schedule(calc_fps)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement