2024-10-08 21:20:23 发布
网友
我希望我的flask应用程序每隔200ms从本地txt文件中获取更新,有可能吗?在
另外,我考虑过apschedulerler中的BackgroundScheduler(),但是粒度是1s
你不能在下一次迭代之前在一个休眠200毫秒的线程中启动一个循环吗?在
不管你在函数里放了什么,每200毫秒就会处理一次
import datetime, threading def foo(): print datetime.datetime.now() threading.Timer(0.2, foo).start() foo()
你不能在下一次迭代之前在一个休眠200毫秒的线程中启动一个循环吗?在
不管你在函数里放了什么,每200毫秒就会处理一次
相关问题 更多 >
编程相关推荐