▶ ALARM SERVICE
Alarm Service is an executable program that implements an alarm clock.
Title: Alarm Service
Author: Noam Y.
OverviewThe alarm watch is set to raise the alarm on preset hour and minute.
ImplementationThe program translates hour and minute data to alarm time in seconds. There are two watchers: current day watcher, new day watcher. Each watcher is responsible to compare the current time to the alarm time and raise the alarm.
The program has the option to raise the alarm almost immediatly, for debugging.
ActionThe program first decides which watcher to use based on the current time vs. alarm time. If the new day watcher is selected, it watches for the passing date event, and activates the current day watcher, until eventually the alarm is raised.