A stopwatch to estimated the total time of a process
Creating a StopWatch:
>>>stopwatch=StopWatch(start, stop)
Start and end are indicators to describe the progress of a process.
Start is the indicator value at the beginning of the process. As default they are 0.0 and 1.0.
Starting the StopWatch again:
>>>stopwatch.restart()
Getting the elapsed time, the total time and the remaining time of the process in seconds:
>>>elapsed, total, remaining = stopwatch(progress)
Where progress is a process progress indicator matching start and stop
Example:
stopwatch=StopWatch(0,10)
for i in range(10):
time.sleep(1)
print('elapsed = %0.2fs, total= %0.2fs, remaining = %0.2fs' % stopwatch(i+1))