https://github.com/rickdgray/etawatch
Like a stopwatch, but it also gives you an ETA
https://github.com/rickdgray/etawatch
Last synced: 5 months ago
JSON representation
Like a stopwatch, but it also gives you an ETA
- Host: GitHub
- URL: https://github.com/rickdgray/etawatch
- Owner: rickdgray
- License: gpl-3.0
- Created: 2023-07-23T16:38:23.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-15T18:40:17.000Z (almost 2 years ago)
- Last Synced: 2025-10-25T19:37:27.452Z (9 months ago)
- Language: Python
- Homepage: https://pypi.org/project/etawatch/
- Size: 44.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Etawatch
Like a stopwatch, but it also gives you an ETA.
Example usage:
```python
# 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:
```python
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.
```python
# will only calculate ETAs based on last 3 lap times
eta = etawatch(10, 3)
```