As seen previously, we use the powerful timer_create(2) system call to create a timer for the calling process (or thread, for that matter):
#include <signal.h>#include <time.h>int timer_create(clockid_t clockid, struct sigevent *sevp, timer_t *timerid);Link with -lrt.
The first parameter passed to timer_create(2) informs the OS of the clock source to be used; we avoid repetition of the matter and refer the reader to the section Obtaining the current time ...