Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

This probably varies between OSes. For cron, the crond manpage indicates that there's a daemon running in the background which activates itself every minute to check if there's a task that needs to be run.

Windows also has a service that does this according to this support page, though I have no idea of its granularity. Its likely it works similarly.

share|improve this answer
Hmm, then I guess it does wake up every minute to check if there are any commands or scripts to run. – Timothy Jan 22 '13 at 14:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .