package com.youngman.photowallfalls;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Mian {
public static void main(String []args){
onSecondsDo();
}
public static void onSecondsDo(){
new Thread(new Runnable() {
@Override
public void run() {
while (true){
try {
Thread.sleep(1000);
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(df.format(new Date()));
if(df.format(new Date()).equals("2018-09-14 15:37:21")){
System.out.println("结束计时");
break;
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}).start();
}
}