日期:2014-05-19 浏览次数:20790 次
public void start() {
timer.schedule(new TimerTask() {
public void run() {
exec();
//timer.cancel();
}
private void exec() {
String tmp = TimeUtil.getAllTime();
String time1 = tmp.substring(0,4);
System.out.println("Timer is Running:"+tmp);
if(time1.equals(mytime1))
{
tds.newFile();
System.out.println("Reach 8:30,create new file");
iswriteFlag =1;
}else if(time1.equals(refreshTime))
{
iswriteFlag =0;
}else
{
}
// Start a new thread to play a sound...
}
}, minutes * 60 * 1000, minutes * 60 * 1000);// 使用毫秒计数
//}, 2000,2000);// 使用毫秒计数
}