import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Main {
public static void main(String []args){
int i=0;
String cmd="calc";
try {
Runtime.getRuntime().exec(cmd).waitFor();
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
new Thread(new Runnable() {
public void run() {
while(true){
System.out.println("123123 ");
try {
String ccmd="calc";
Runtime.getRuntime().exec(ccmd).waitFor();
Thread.sleep(1000);
} catch(IOException e){
e.printStackTrace();
}catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}).start();
while(true)
try {
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(df.format(new Date())+" "+i++);
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}