diff --git a/requirements.txt b/requirements.txt index f3d7347..4a2f3a2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ bs4~=0.0.1 beautifulsoup4~=4.12.2 fishhook~=0.2.9 pygame~=2.5.2 -requests~=2.31.0 \ No newline at end of file +requests~=2.31.0 +tqdm~=4.66 \ No newline at end of file diff --git a/src/tools/aoc.py b/src/tools/aoc.py index b3a640a..748f45c 100644 --- a/src/tools/aoc.py +++ b/src/tools/aoc.py @@ -9,6 +9,7 @@ from bs4 import BeautifulSoup from .datafiles import JSONFile from .stopwatch import StopWatch from typing import Any, Callable, List, Tuple, Type +from tqdm.auto import tqdm from .tools import get_script_dir BASE_PATH = get_script_dir() @@ -55,10 +56,11 @@ class AOCDay: if not measure_runtime or case_count < len(self.inputs[part]) - 1: answer = self.part_func[part]() else: - stopwatch = StopWatch() - for _ in range(timeit_number): + stopwatch = StopWatch(auto_start=False) + for _ in tqdm(range(timeit_number), desc=f"Part {part+1}", leave=False): + stopwatch.start() answer = self.part_func[part]() - stopwatch.stop() + stopwatch.stop() exec_time = stopwatch.avg_string(timeit_number) if solution is None: