Print how long it took for the script to run in verbose mode

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2019-11-19 14:17:27 +01:00 committed by Nils Philippsen
parent 71b7245439
commit f925d6424e

View file

@ -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)