CiscoTheProot/yaml parse test/util.py
CiscoTheWolf 9c008eb58d Further optimisations and rustification of interpolation
Co-authored-by: Patrickfen <Patrickfen@users.noreply.github.com>
2023-10-03 23:17:32 +02:00

13 lines
No EOL
355 B
Python

from time import time
def timer(func):
# This function shows the execution time of
# the function object passed
def wrap_func(*args, **kwargs):
t1 = time()
result = func(*args, **kwargs)
t2 = time()
print(f'Function {func.__name__!r} execution: {(t2-t1):.4f}s')
return result
return wrap_func