>>> from time import time
>>>
>>> def timeit(func):
...     def wrapper(*args, **kwargs):
...         start = time()
...         result = func(*args, **kwargs)
...         end = time()
...         duration = end - start
...         print(f'Duration: {duration=:.9f} seconds')
...         return result
...     return wrapper
>>>
>>>
>>> @timeit
... def add(a, b):
...     return a + b
>>>
>>>
>>> add(1,2)
Duration: duration=0.000001192 seconds
3