From 4b2f5c62e82ed7146a78ff48b2abb90c870e69de Mon Sep 17 00:00:00 2001 From: Pascal Lais Date: Fri, 10 Dec 2021 08:53:49 +0100 Subject: [PATCH] Update run_all.py Print total run time at the end. --- run_all.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/run_all.py b/run_all.py index 8171ae8..3d86edd 100644 --- a/run_all.py +++ b/run_all.py @@ -9,6 +9,7 @@ from time import time for dir in [x for x in sorted(listdir('.')) if isdir(x)]: file = dir + '/' + dir + '.py' input = dir + '/input.txt' + total_run_time = 0 if isfile(file) and isfile(input): print('--------------------------------') print(dir, ':', sep='') @@ -19,4 +20,8 @@ for dir in [x for x in sorted(listdir('.')) if isdir(x)]: end_time = time() if p.returncode != 0: raise CalledProcessError(p.returncode, p.args) - print(f'Runtime: {end_time-start_time:.2f} s') + run_time = end_time-start_time + total_run_time += run_time + print(f'Runtime: {run_time:.2f} s') + print('--------------------------------') + print(f'Runtime: {total_run_time:.2f} s')