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

Fix printing total run time.
This commit is contained in:
2021-12-10 08:54:58 +01:00
parent 4b2f5c62e8
commit e60bacf710

View File

@@ -5,11 +5,11 @@ from os.path import isdir, isfile
from subprocess import Popen, PIPE, CalledProcessError from subprocess import Popen, PIPE, CalledProcessError
from time import time from time import time
total_run_time = 0
for dir in [x for x in sorted(listdir('.')) if isdir(x)]: for dir in [x for x in sorted(listdir('.')) if isdir(x)]:
file = dir + '/' + dir + '.py' file = dir + '/' + dir + '.py'
input = dir + '/input.txt' input = dir + '/input.txt'
total_run_time = 0
if isfile(file) and isfile(input): if isfile(file) and isfile(input):
print('--------------------------------') print('--------------------------------')
print(dir, ':', sep='') print(dir, ':', sep='')
@@ -23,5 +23,5 @@ for dir in [x for x in sorted(listdir('.')) if isdir(x)]:
run_time = end_time-start_time run_time = end_time-start_time
total_run_time += run_time total_run_time += run_time
print(f'Runtime: {run_time:.2f} s') print(f'Runtime: {run_time:.2f} s')
print('--------------------------------') print('--------------------------------')
print(f'Runtime: {total_run_time:.2f} s') print(f'Runtime: {total_run_time:.2f} s')