feature request - throttle iterations per seconds #776
Labels
p3-enhancement 🔥
Much new such feature
p5-wont-fix ☮
Sorry
question/docs ‽
Documentation clarification candidate
submodule ⊂
Periphery/subclasses
read the known issues
environment, where applicable:
('4.32.2', '2.7.16 (default, Mar 4 2019, 09:02:22) \n[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)]', 'darwin')
would be nice to add throttle to limit it/s, here the example:
from time import time, sleep
from tqdm import tqdm
fps=20
frameperiod=1.0/fps
now=time()
nextframe=now+frameperiod
for frame in tqdm(range(1020)):
do_something()
while now<nextframe:
sleep(nextframe-now)
now=time()
nextframe+=frameperiod
The text was updated successfully, but these errors were encountered: