The first step is to create the timer with timer_create():
#include <time.h> #include <sys/siginfo.h> int timer_create (clockid_t clock_id, struct sigevent *event, timer_t *timerid);
The clock_id argument tells the timer_create() function which time base you're creating this timer for. This is a POSIX thing—POSIX says that on different platforms you can have multiple time bases, but that every platform must support at least the CLOCK_REALTIME time base. Under QNX Neutrino, the time bases to choose from include the following:
For now, we'll ignore CLOCK_SOFTTIME and CLOCK_MONOTONIC (even though CLOCK_MONOTONIC is the best choice for timers), but we will come back to them in the Other clock sources section, below.