From f925d6424e5b3a5b0f433df0bb58697fc3a308cf Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Tue, 19 Nov 2019 14:17:27 +0100 Subject: [PATCH] Print how long it took for the script to run in verbose mode Signed-off-by: Pierre-Yves Chibon --- pagure_sync_bugzilla.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pagure_sync_bugzilla.py b/pagure_sync_bugzilla.py index 3e8a278..9228da0 100644 --- a/pagure_sync_bugzilla.py +++ b/pagure_sync_bugzilla.py @@ -636,6 +636,7 @@ def _to_legacy_schema(product_and_project_and_summary, session=None): def main(): """The entrypoint to the script.""" global VERBOSE, DRYRUN, projects_dict + start = time.time() parser = argparse.ArgumentParser( description='Script syncing information between Pagure and bugzilla' @@ -801,6 +802,10 @@ def main(): with open(DATA_CACHE, 'w') as stream: json.dump({}, stream) + if VERBOSE: + delta = time.time() - start + print("Ran for %s seconds -- ie: %.2f minutes" % (delta, delta/60.0)) + sys.exit(0)