// 22.5HV2 Software Engineering II // Unit 2 Exercise 2 import java.io.*; public class test_alarm_clock { public static void main(String[] args) { Alarm_clock timer = new Alarm_clock(10,15,57); 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 } } }