Timer类
```
public class Demo {
public static void main(String[] args) throws IOException, InterruptedException {
Timer t = new Timer();
t.schedule(new MyTimerTask(), new Date(117, 1, 4, 8, 28, 45));
new Thread(){
@Override
public void run() {
while(true){
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println(new MyDatetime(System.currentTimeMillis()).getCn());
}
}
}.start();
}
}
class MyTimerTask extends TimerTask {
@Override
public void run() {
System.out.println("这里是闹钟");
}
}
```