try new timer
This commit is contained in:
15
lib_test.py
Normal file
15
lib_test.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# lib_test.py:
|
||||
|
||||
from wrapt_timeout_decorator import *
|
||||
from time import sleep
|
||||
from conf_my_program import conf_my_program
|
||||
|
||||
# use_signals = False is not really necessary here, it is set automatically under Windows
|
||||
# but You can force NOT to use Signals under Linux
|
||||
@timeout(5, use_signals=False)
|
||||
def mytest():
|
||||
print("Start ", conf_my_program.name)
|
||||
for i in range(1,10):
|
||||
sleep(1)
|
||||
print("{} seconds have passed".format(i))
|
||||
return i
|
||||
Reference in New Issue
Block a user