timer_events
attribute
PT= ParamSpec('PT')
attribute
stop_event= threading.Event()
attribute
timer_events_tabledict[int, list[tuple[str, Callable, tuple, dict, int]]]
= {}
attribute
timer_event_lock= threading.Lock()
func
timer_event(t, name=None, thread_priority=ToolDeltaThread.PLUGIN)
将修饰器下的方法作为一个定时任务, 每隔一段时间被执行一次。 注意: 请不要在函数内放可能造成堵塞的内容 注意: 当方法被 timer_event 修饰后, 需要调用一次该方法才能开始定时任务线程!
Args: seconds (int): 周期秒数 name (Optional[str], optional): 名字, 默认为自动生成的
@timer_event(60, "定时问好")
def greeting():
print("Hello!")
greeting()
param
tint
param
namestr | None
= None
param
thread_priority= ToolDeltaThread.PLUGIN
Returns
None
func
reset()
清理所有定时任务
Returns
None
func
stopall()
Returns
None
func
timer_event_boostrap()
启动定时任务, 请不要在系统调用以外调用
Returns
None
func
_internal_timer_event_boostrap()
Returns
None