Spaces:
Runtime error
Runtime error
File size: 287 Bytes
e0f25ed |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
from timeit import default_timer as tmr
counter = 0
def time_function(f, name):
global counter
t = "\t" * counter
# print(f"{t}Starting... {name}")
ss = tmr()
counter += 1
a = f()
counter -= 1
print(f"{t}{name} took {tmr() - ss} seconds")
return a
|