in reply to Alternatives to Mixing Alarm and Sleep
Yes, they are called event-loop systems. See POE or Glib
See Roll your own Event-loop for an example of Glib. POE comes with a cookbook of examples. You want to setup a timer.