// 22.5HV2 Software Engineering II // Unit 2 Exercise 2 import java.io.*; import Alarm_clock.*; public class test_alarm_clock { public static void main(String[] args) { Alarm_clock timer = new Alarm_Clock(10,15,12); // create timer and set to 10.15.12am long t1, t2; // time_t is struct in time.h timer.set_alarm(); // set alarm time while (true) { // i.e. repeat indefinitely! t1 = t2 = System.CurrentTimeMillis(); // get current time in milliseconds while (t2-t1 < 1000) { // wait for 1 second t2 = System.CurrentTimeMillis(); } timer.tick(); // advance timer by 1 second (also check alarm time) timer.show_time(); // display time } } }