超时助手
timeouter的Python项目详细描述
计时器
Python超时帮助工具库
安装
pip3installtimeouter
示例
简单的类用法
^{pr2}$自定义超时异常
单个计时器对象的异常
classMyException(Exception):passt.set_exception_class(MyException)
所有新计时器的默认例外
classMyException(Exception):passtimeouter.set_default_exception_class(MyException)
线程本地用法
importtimeouterasto# init for the current threadto.init(1)time.sleep(2)# module methods check, get, has, reset, set_timeout and set_exception_class# are proxied to thread-local objectto.check()
- 项目
标签: