>>> 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
>>>
>>>
>>> def debug(func):
...     def wrapper(*args, **kwargs):
...         function = func.__name__
...         result = func(*args, **kwargs)
...         print(f'Calling: {function=}, {args=}, {kwargs=}, {result=}')
...         return result
...     return wrapper
>>>
>>>
>>> @timeit
... @debug
... def add(a, b):
...     return a + b
>>>
>>>
>>> add(1,2)
Calling: function='add', args=(1, 2), kwargs={}, result=3
Duration: duration=0.000015974 seconds
3

#%%

add = timeit(debug(add)) add(1,2)