/**
* Title: ExceptionPlay
* Description: Exploring the Exception base class
* @author hollingd@cs.rpi.edu
*/
public class ExceptionPlay {
public static void main(String[] args) {
boolean done=false;
int seconds=0;
try {
seconds = Integer.parseInt(args[0]);
} catch (Exception e) {
System.out.println("Please specify the number of seconds");
System.exit(1);
}
long initialtime = System.currentTimeMillis();
while (!done) {
try {
if (System.currentTimeMillis()-initialtime<seconds*1000)
throw new Exception("Not Yet - keep trying");
done=true;
} catch (Exception e) {
System.out.println(e);
}
}
System.out.println("Done!\n");
}
}