The alarm() function causes the system to generate a SIGALRM signal for the process after the number of real-time seconds specified by seconds have elapsed. [B]Processor scheduling delays may prevent the process from handling the signal as soon as it is generated. [/B]
===========================
int getitimer(int which, struct itimerval *value);
int setitimer(int which, const struct itimerval *value,
struct itimerval *ovalue);
The getitimer() function stores the current value of the timer specified by which into the structure pointed to by value. The setitimer() function sets the timer specified by which to the value specified in the structure pointed to by value, and if ovalue is not a null pointer, stores the previous value of the timer in the structure pointed to by ovalue.
A timer value is defined by the itimerval structure. If it_value is non-zero, it indicates the time to the next timer expiration. If it_interval is non-zero, it specifies a value to be used in reloading it_value when the timer expires. Setting it_value to 0 disables a timer, regardless of the value of it_interval. Setting it_interval to 0 disables a timer after its next expiration (assuming it_value is non-zero).
Implementations may place limitations on the granularity of timer values. For each interval timer, if the requested timer value requires a finer granularity than the implementation supports, the actual timer value will be [B]rounded up to the next supported value[/B].
On successful completion, the object pointed to by the timeout argument may be modified.
Implementations may place limitations on the maximum timeout interval supported. On all implementations, the maximum timeout interval supported will be at least 31 days. If the timeout argument specifies a timeout interval greater than the implementation-dependent maximum value, the maximum value will be used as the actual timeout value. Implementations may also place limitations on the granularity of timeout intervals. If the requested timeout interval requires a finer granularity than the implementation supports, the [B]actual timeout interval will be rounded up to the next supported value[/B].