Created
August 18, 2021 19:29
-
-
Save sengstacken/a6ad14b895dc94d9ce08891c64cce0bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from tqdm.auto import tqdm | |
mins = 10 | |
with tqdm(desc="Break Timer", total=mins*60, bar_format="{l_bar}{bar} {elapsed_s:.0f}/{total} seconds") as pbar: | |
start = time.time() | |
now = time.time() | |
prev_now = now | |
while (now - start) < mins*60: | |
pbar.update(now - prev_now) | |
time.sleep(1) | |
prev_now = now | |
now = time.time() | |
pbar.update(time.time() - prev_now) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment