Pygame FPS 比我想要的快
Pygame FPS faster than what I want
我正在尝试 运行 以 80 帧/秒的速度运行游戏,但我得到的是 83 帧/秒?!怎么回事?
while 1:
start = time()
clock.tick_busy_loop(80)
self.update()
fps=int(1./(time()-start))
print fps, 'fps'
>> 83 fps
Resolution of pygame clock = 1 msec
80 fps = 12.5 msec
83 fps = 12 msec
int(12.5) = 12
我正在尝试 运行 以 80 帧/秒的速度运行游戏,但我得到的是 83 帧/秒?!怎么回事?
while 1:
start = time()
clock.tick_busy_loop(80)
self.update()
fps=int(1./(time()-start))
print fps, 'fps'
>> 83 fps
Resolution of pygame clock = 1 msec
80 fps = 12.5 msec
83 fps = 12 msec
int(12.5) = 12