I want to code decorator which interrupt function after 1 sec, so:
@timer
def func():
sleep(0.1)
is OK
, but
@timer
def func():
sleep(1.1)
is RunTimeError
.
But i dont understand where in decorator i should code signal. maybe there are similar examples?