8000 GitHub - rickdgray/etawatch: Like a stopwatch, but it also gives you an ETA
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rickdgray/etawatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Etawatch

Like a stopwatch, but it also gives you an ETA.

Example usage:

# construction immediately starts timer
eta_watch = etawatch(5)
for i in range(number_of_laps):
    # do some work
    time.sleep(random.randint(1, 3))
    eta, lap = eta_watch()
    print(f'Lap: {i+1} | Time: {lap:.2f} sec | ETA: {eta:.2f} min')

Another example:

for i, (eta, lap) in enumerate(etawatch(5)):
    # do some work
    time.sleep(random.randint(1, 3))
    print(f'Lap: {i+1} | Time: {lap:.2f} sec | ETA: {eta:.2f} min')

It can optionally predict ETA by only the last n number of runs.

# will only calculate ETAs based on last 3 lap times
eta = etawatch(10, 3)

About

Like a stopwatch, but it also gives you an ETA

Resources

License

Stars

Watchers

Forks

Languages

0