12 lines
280 B
Python
12 lines
280 B
Python
import time
|
|
|
|
|
|
def print_execution_time(day, part, avg_time):
|
|
units = ['s', 'ms', 'μs', 'ns']
|
|
unit = 0
|
|
while avg_time < 1:
|
|
avg_time *= 1000
|
|
unit += 1
|
|
|
|
print("Average execution time for day %s part %s: %1.2f%s" % (day, part, avg_time, units[unit]))
|