当前位置:网站首页>Scheduledexecutorservice timer
Scheduledexecutorservice timer
2022-07-07 05:14:00 【Yang Asang 815】
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class TestDamo {
public static void main(String[] args){
//ScheduledExecutorService Internal thread pool Make up for Timer The defects of
ScheduledExecutorService pool = Executors.newScheduledThreadPool(3);
pool.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
System.out.println(Thread.currentThread()+" Do it once ");
}
},0,2, TimeUnit.SECONDS);
}
}
ScheduledExecutorService Internal thread pool Make up for Timer The defects of
边栏推荐
- PMP证书有没有必要续期?
- If you‘re running pod install manually, make sure flutter pub get is executed first.
- Stm32f103ze+sht30 detection of ambient temperature and humidity (IIC simulation sequence)
- Leetcode minimum difference in student scores
- U++ game learning notes
- STM32F103 realize IAP online upgrade application
- PLC模拟量输出 模拟量输出FB analog2NDA(三菱FX3U)
- 《四》表单
- Complete code of C language neural network and its meaning
- [QT] custom control loading
猜你喜欢
随机推荐
高数中值定理总结
Error: No named parameter with the name ‘foregroundColor‘
Salesforce 容器化 ISV 场景下的软件供应链安全落地实践
Auto. JS get all app names of mobile phones
torch optimizer小解析
Decorator basic learning 02
Longest non descent subsequence (LIS) (dynamic programming)
Development thoughts of adding new requirements in secondary development
最全常用高数公式
Pointer and array are input in function to realize reverse order output
PLC模拟量输出 模拟量输出FB analog2NDA(三菱FX3U)
Is it necessary to renew the PMP certificate?
Leetcode(417)——太平洋大西洋水流问题
线程同步的两个方法
想要选择一些部门优先使用 OKR, 应该如何选择试点部门?
The most complete learning rate adjustment strategy in history LR_ scheduler
sublime使用技巧
LabVIEW在打开一个新的引用,提示内存已满
Is PMP really useful?
qt 简单布局 盒子模型 加弹簧