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

#%%

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