You can also run
Poe or
Glib and run timers. The advantage to this, is that you can set up multiple timers, to fire things off.... instead of relying on sleep. Sleep will use the absolute minimum cpu though. See
Readkey with timer using Glib and
Roll your own Event-loop for example.