What is the best algorithm to implement a simple timer library. The library should allow the following:
On POSIX-ish systems, you can use the timer_create/timer_settime family of functions to provide a lot of this "for free."