Having looked at all this wonderful theory, let's turn our attention to some specific code samples to see what you can do with timers.
To work with a timer, you must:
- Create the timer object.
- Decide how you wish to be notified (signal, pulse, or thread creation), and create the notification structure (the struct sigevent).
- Decide what kind of timer you wish to have (relative versus absolute, and one-shot versus periodic).
- Start it.
Let's look at these in order.