time monitoring
Project description
tprogress
Simple time capturing for python, that logs the time passed since last call with logger level.DEBUG.
How-to
Time Logging
- Create tprogress class instance, e.g. timep = tprogress.progress() . Starts the clock.
- Call tprogress.elapsed_time (self,stage='') that returns a formatted string with time and in debug mode the time. The argument stage is a string that can be used to state at what stage the program is when called.
Example
- DEBUG:tprogress:Elapsed Time: 1m 0.683s ( 0: 1:0.7) - Backward Calculation of Rank
Time Monitoring
- Create tprogress class instance, e.g. timep = tprogress.progress(max_num=100,step_size=1,freq=5) . Starts the clock.
- Call tprogress.monitor() within a large for-loop that tells about how far program is and predicts when the loop is finished. The setting is done in the init call:
- max_num: Number of loops, e.g. 100
- step_size: Size of step, e.g. 1
- freq: How often an info print should be done, e.g. 5, every 5th loop iteration
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tprogress-0.0.5.tar.gz
(2.3 kB
view hashes)