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)]:
|
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='')
|
||||||
@@ -19,4 +20,8 @@ for dir in [x for x in sorted(listdir('.')) if isdir(x)]:
|
|||||||
end_time = time()
|
end_time = time()
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise CalledProcessError(p.returncode, p.args)
|
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