Like a stopwatch, but it also gives you an ETA
Project description
Etawatch
Like a stopwatch, but it also gives you an ETA.
Example usage:
number_of_laps = 10
# construction immediately starts timer
eta = etawatch(number_of_laps)
for i in range(number_of_laps):
time.sleep(random.randint(1, 5))
eta, iteration_time = eta()
print(f'Time: {iteration_time:.2f} sec | Done in {eta:.2f} min')
Another example:
number_of_laps = 10
for i, eta, last_iter_time in enumerate(etawatch(number_of_laps)):
time.sleep(random.randint(1, 5))
print(f'Time: {iteration_time:.2f} sec | Done in {eta:.2f} min')
It can optionally predict ETA by only the last n
number of runs.
# will run 10 laps but only return ETAs based on last 3
eta = etawatch(10, 3)
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
etawatch-1.0.1.tar.gz
(39.2 kB
view hashes)
Built Distribution
etawatch-1.0.1-py3-none-any.whl
(27.4 kB
view hashes)