Use wrapper as a decorator
We can get the same result by putting @wrap as a decorator above the definition of our function.
from wrapper import wrap
import time
@wrap
def myfunc():
print("myfunc started")
time.sleep(1)
print("myfunc ended")
myfunc()