import java.util.Date ;
public class myProg
{
public static void main(String[] args)
{
Date d;
// Print out the time out when the program starts
d = new Date();
System.out.println("Starting time of program is: " + d);
// Write code here to make the program wait for 5 seconds (= 5000 msec)
Date x = new Date();
while ( x.getTime() - d.getTime() < 5000 )
x = new Date();
// Print out the time out when the program ends
d = new Date();
System.out.println("Endtime time of program is: " + d);
}
}
|