try new timer

This commit is contained in:
Jason Lee
2024-03-16 11:54:45 +08:00
parent 1a53a28475
commit 44679724b8
10 changed files with 106 additions and 97 deletions

15
lib_test.py Normal file
View 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