java 定时器
来源:互联网 发布:去除重复的记录查询sql 编辑:程序博客网 时间:2024/05/16 04:34
Timer timer = new Timer();
Calendar currentTime = Calendar.getInstance();
currentTime.setTime(new Date());
int currentHour = currentTime.get(Calendar.HOUR);
currentTime.set(Calendar.HOUR, currentTime.get(Calendar.HOUR));
currentTime.set(Calendar.MINUTE, currentTime.get(Calendar.MINUTE));
currentTime.set(Calendar.SECOND, currentTime.get(Calendar.SECOND));
currentTime.set(Calendar.MILLISECOND,currentTime.get(Calendar.MILLISECOND));
long do_per_seconds = mgr.getWaitTime()*1000;
Date NextHour = currentTime.getTime();
timer.scheduleAtFixedRate(new ReportTasks(),NextHour,do_per_seconds);
public class ReportTasks extends TimerTask {
public void run() {
System.out.println("Hello World");
}
- [Java--定时器]--定时器举例
- JAVA定时器
- java 定时器
- JAVA定时器
- java定时器
- JAVA定时器
- Java定时器
- JAVA定时器
- JAVA定时器
- java定时器
- Java定时器
- JAVA 定时器
- java定时器
- java定时器
- java定时器
- java定时器
- java定时器
- java 定时器
- (NOT CLEAR)Question 21: Which of the following statements provide a valid reason not to use RTTI for distributed (i.e. networked
- 华为低端路由器 在内网配置VPN绑定端口问题
- (NOT CLEAR)Question 22: Which of the following functions of the ifstream class can be used to determine the current position of
- Question 23: Which of the following C++ keywords are designed to speed up execution of a C++ function?
- undefined symbol: __gxx_personality_v0解决办法(转载)
- java 定时器
- 某php加密算法的java版本
- JSTL 标签库详细介绍资料
- IO文件操作
- 今天处理了一下dedecms中的fck编辑器不能在ff中使用的问题.
- poj2195——Going Home
- 验证视图状态 MAC 失败的处理办法总结(转自:http://hi.baidu.com/motiansen/blog/item/2c10d5031bc9b67b3912bbb5.html)
- 远程线程注入时遇到的问题
- 回文字符用递归的解法