diff --git a/src/scripts/miade.py b/src/scripts/miade.py index 288b87f..239bade 100644 --- a/src/scripts/miade.py +++ b/src/scripts/miade.py @@ -4,6 +4,7 @@ import datetime import logging import re +import time from typing_extensions import Dict import typer @@ -628,6 +629,7 @@ def make(config_filepath: Path, temp_dir: Path = Path("./.temp"), output: Path = """ Build a model from a specification file. """ + start_time = time.time() log.info(f"Making temporary directory: {temp_dir}") temp_dir.mkdir(parents=True, exist_ok=True) @@ -814,6 +816,12 @@ def make(config_filepath: Path, temp_dir: Path = Path("./.temp"), output: Path = rmtree(temp_dir) + elapsed_time = time.time() - start_time + hours = int(elapsed_time // 3600) + minutes = int((elapsed_time % 3600) // 60) + seconds = int(elapsed_time % 60) + print(f"Time taken: {hours}h {minutes}m {seconds}s") + if __name__ == "__main__": app()