【发布时间】:2020-02-11 18:35:24
【问题描述】:
java中延迟后如何调用特定函数?
{
// Do something
callmeafterevery10sec () // call this function in every 10 sec while continue the whole thing
// Do something
}
【问题讨论】:
-
听起来像是 ScheduledExecutorService 的作业。您应该查看此类的 JavaDoc。有很好的例子。
标签: java multithreading timer