当前位置:网站首页>Timer create timer
Timer create timer
2022-07-07 05:14:00 【Yang Asang 815】
import java.util.Timer;
import java.util.TimerTask;
public class TestDamo {
public static void main(String[] args) {
Timer timer=new Timer();// The timer itself is a thread
timer.schedule(new TimerTask() {
@Override
public void run() {
System.out.println(Thread.currentThread()+" Do it once ");
}
},3000,2000);
/*
* Timer A single thread , Process multiple tasks and execute them in sequence , There is a difference between the delay and the time of setting the timer
* Maybe because of one of the exceptions Timer Thread death , Thus affecting subsequent tasks ,
* */
}
} Timer A single thread , Process multiple tasks and execute them in sequence , There is a difference between the delay and the time of setting the timer
* Maybe because of one of the exceptions Timer Thread death , Thus affecting subsequent tasks ,
边栏推荐
- 3.基金的类型
- y58.第三章 Kubernetes从入门到精通 -- 持续集成与部署(三一)
- Pointer and array are input in function to realize reverse order output
- Appium practice | make the test faster, more stable and more reliable (I): slice test
- Ansible概述和模块解释(你刚走过了今天,而扑面而来的却是昨天)
- [opencv] image morphological operation opencv marks the positions of different connected domains
- Salesforce 容器化 ISV 场景下的软件供应链安全落地实践
- PLC模拟量输出 模拟量输出FB analog2NDA(三菱FX3U)
- torch optimizer小解析
- Longest non descent subsequence (LIS) (dynamic programming)
猜你喜欢

U++ metadata specifier learning notes

SQL injection cookie injection

SQL injection - secondary injection and multi statement injection

CentOS 7.9安装Oracle 21c历险记

U++4 interface learning notes

《二》标签

Full link voltage test: the dispute between shadow database and shadow table

qt 简单布局 盒子模型 加弹簧

01 machine learning related regulations

使用知云阅读器翻译统计遗传学书籍
随机推荐
Thread和Runnable创建线程的方式对比
Appium practice | make the test faster, more stable and more reliable (I): slice test
App embedded H5 --- iPhone soft keyboard blocks input text
谈谈讲清楚这件事的重要性
Error: No named parameter with the name ‘foregroundColor‘
What changes will PMP certification bring?
STM32F103ZE+SHT30检测环境温度与湿度(IIC模拟时序)
最长回文子串(动态规划)
Dynamically generate tables
U++4 接口 学习笔记
批量归一化(标准化)处理
PMP证书有没有必要续期?
STM32 encapsulates the one key configuration function of esp8266: realize the switching between AP mode and sta mode, and the creation of server and client
DBSync新增对MongoDB、ES的支持
ServiceMesh主要解决的三大痛点
【二叉树】二叉树寻路
Sublime tips
Is PMP really useful?
Flask项目使用flask-socketio异常:TypeError: function() argument 1 must be code, not str
DFS, BFS and traversal search of Graphs