Ai
1 Star 0 Fork 0

touchx/poium

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_func_time.py 476 Bytes
一键复制 编辑 原始数据 按行查看 历史
defnngj 提交于 2024-09-03 19:37 +08:00 . test: rename tests
import time
from setuptools import setup, find_packages
from poium.common.exceptions import FuncTimeoutException
from poium.libs.func_timeout import func_timeout
@func_timeout(3)
def my_function(sec: int):
time.sleep(sec)
return f"Finished after {sec} seconds"
if __name__ == '__main__':
try:
print(time.ctime())
result = my_function(5)
print(result)
except FuncTimeoutException as e:
print(e)
print(time.ctime())
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/touchx_admin/poium.git
git@gitee.com:touchx_admin/poium.git
touchx_admin
poium
poium
master

搜索帮助