From d9abb8f208c9b961f282b19b695aaf572b73b6a6 Mon Sep 17 00:00:00 2001 From: 0xChloe Date: Mon, 2 Sep 2024 17:01:26 +0000 Subject: [PATCH] Adding perf counter --- spotiplex/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spotiplex/main.py b/spotiplex/main.py index 38d6f49..095a512 100644 --- a/spotiplex/main.py +++ b/spotiplex/main.py @@ -1,6 +1,7 @@ """Init for Typer app/main functions.""" import sys +from time import perf_counter import typer from loguru import logger @@ -34,8 +35,12 @@ def generate_env() -> None: @app.command() def sync_manual_lists() -> None: """Syncs all playlists specified in config file.""" + start = perf_counter() sp_instance = sp_module.Spotiplex(lidarr=False, playlist_id=None) sp_instance.run() + stop = perf_counter() + print("Elapsed time:", stop, start) + print("Elapsed time during the whole program in seconds:", stop - start) # Uncomment and complete this function if needed in the future