java如何延迟ScheduledExecutorService?
我有一个ScheduledExecutorService
定期执行任务:
executor.scheduleWithFixedDelay(new Runnable() {
在特定事件中,我希望重置或延迟时间表的时间。如何做到这一点
你可以在下面搜索框中键入要查询的问题!
我有一个ScheduledExecutorService
定期执行任务:
executor.scheduleWithFixedDelay(new Runnable() {
在特定事件中,我希望重置或延迟时间表的时间。如何做到这一点
# 1 楼答案
您需要保留对该方法返回的
Future<?>
的引用然后调用
cancel
并以不同的速率再次调度它