Update run_all.py
All checks were successful
continuous-integration/drone/push Build is passing

Print total run time at the end.
This commit is contained in:
2021-12-10 08:53:49 +01:00
parent 8c0e9e4bda
commit 4b2f5c62e8

View File

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