Print total run time at the end.
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user