semvec/pypi-packages huggingface dataset:
tim 0.5
TIM: Timed Iteration Monitor
License: WTFPL

('Tim: Timed iteration monitor\n============================\n\nA common pattern I have when writing code to import or treat large chunk of data is to do some printing to track the progress and some timing to monitor the speed.\nSo I often end up with some variation of this in my code:\n\n```python\nfrom datetime import datetime\nstart = datetime.now()\nn = 0\nfor i in my_iter:\n    n+=1\n    print "\\r", i,\n    # do stuff\nprint start - datetime.now()\nprint (start - datetime.now()) / n / 100\n```\n\n\nwhich is a lot to remember and type which in turn make it easy to introduce bugs in some edge case which you need then to debug.\n\nSo I wrote tim to help me do just that, so I have this pattern ready for use and working and can spend my time coding my data treatment instead of debbugging my helper code.\n\n*WARNING* : This is alpha level stuff, I\'m still working out the proper way to do stuff so the API may still change a bit.\n\nHow to use tim\n--------------\n\nCommon usage pattern would probably be:\n\n```python\nimport tim\n\ntim.start()\nfor i in my_iter:\n    tim.pulse_print() # print current progress\n    # do stuff\ntim.stop() # print overall stats and reset counter\n```\n\nIf you just need to monitor start and stop you can use:\n\n```python\ntim.start()\n# calculation\ntim.stop() # print elapsed time and reset\n```\n\n\nInstallation\n------------\n\n    pip install tim\n',)