Timer signals
Three interval timers are maintained for each process:
- SIGALRM (real-time alarm, like a stopwatch)
- SIGVTALRM (virtual-time alarm, measuring CPU time)
- SIGPROF (used for profilers, which we’ll cover later)
Useful functions to set and get timer info are:
- setitimer(), getitimer()
- alarm() (simpler version: only sets SIGALRM)
- pause() (suspend until next signal arrives)
- sleep() (caused calling process to suspend)
- usleep() (like sleep(), but with finer granularity)
Note: sleep() and usleep() are interruptible by other signals