Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request - throttle iterations per seconds #776

Open
superuser5 opened this issue Jul 18, 2019 · 2 comments
Open

feature request - throttle iterations per seconds #776

superuser5 opened this issue Jul 18, 2019 · 2 comments
Assignees
Labels
p3-enhancement 🔥 Much new such feature p5-wont-fix ☮ Sorry question/docs ‽ Documentation clarification candidate submodule ⊂ Periphery/subclasses

Comments

@superuser5
Copy link

  • [y] I have visited the source website, and in particular
    read the known issues
  • [y] I have searched through the issue tracker for duplicates
  • [y] I have mentioned version numbers, operating system and
    environment, where applicable:
    import tqdm, sys
    print(tqdm.__version__, sys.version, sys.platform)

('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

@casperdcl
Copy link
Sponsor Member

not sure if this is really something that tqdm should do. Your user code seems fine.

@casperdcl casperdcl self-assigned this Jul 18, 2019
@casperdcl casperdcl added p3-enhancement 🔥 Much new such feature question/docs ‽ Documentation clarification candidate submodule ⊂ Periphery/subclasses p5-wont-fix ☮ Sorry labels Jul 18, 2019
@casperdcl
Copy link
Sponsor Member

perhaps you could subclass tqdm adding this ability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-enhancement 🔥 Much new such feature p5-wont-fix ☮ Sorry question/docs ‽ Documentation clarification candidate submodule ⊂ Periphery/subclasses
Projects
None yet
Development

No branches or pull requests

2 participants