tqdm/tqdm

Allow option to run the loop at a specified slower rate

Opened this issue · 0 comments

  • I have marked all applicable categories:
    • documentation request (i.e. "X is missing from the documentation." If instead I want to ask "how to use X?" I understand StackOverflow#tqdm is more appropriate)
    • new feature request
  • I have visited the source website, and in particular
    read the known issues
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and
    environment, where applicable:
    import tqdm, sys
    print(tqdm.__version__, sys.version, sys.platform)

I often write loops that i need to slow down (for real time simulations, animations, sending data to peripherals at specific intervals). Now I often add boilerplate sleep code to my loop, but it could easily be integrated into tqdm. I would love it if there was an option like for i in tqdm(range(N), target_looptime=0.01): and then i not only get a progress bar, but also my loop runs at 100 iterations per (wall-clock) second, if possible. If not possible, then the loop should run as fast as possible as if the option was never specified.

Do you see this as feasible/desirable?