If you have "Unix Network Programming" by Richard Stevens then you can look it up to see how to install a signal, and how to set the timer values for the SIGALRM signal.
For threads just search for 'Posix Thread Tutorial' in google and you will get load of tutorials telling with example code how to do it. One of the tutorials is at this link
If the purpose of your function is only to check the timer value and set some flag based on its value then i would recomment using SIGALRM. Otherwise go for threads.