How do programs designed for scheduling (e.g. Task Scheduler in Windows, cron in Unix systems) know that it "is time" for them to run a certain scheduled command or script?
I imagine it's not something like a timed function checking the system clock every second or minute. Is there some kind of trigger being activated when a time stamp corresponding to a certain planned task is reached?