/************************* * Function: Get clock interval * parameter: which: Set which clock * itimer_real: real-time decrement, timeout to send SIGALRM signal * ITIMER _virturl: Virtual clock, timeout send sigvalrm clock * itimer_prof: * **********************/intGetitimer (intWhich,structItimerval *curr_value);/************************* * Function: Set clock interval * parameter: which: Set which clock * itimer_real: real-time decrement, time-out to send SIGALRM signal * ITIMER _virturl: Virtual clock, timeout send sigvalrm clock * itimer_prof: * new_value: New clock * old_value: Old time * ******************** **/intSetitimer (intWhich,Const structItimerval *new_value,structItimerval *old_value);
Time assignment is atomic operationstructItimerval {structTimeval It_interval;/*Next Value*/ structTimeval It_value;/*Current value*/};structTimeval {LongTv_sec;/*seconds*/ LongTv_usec;/*microseconds*/};
Linux high-coding signal-------Setitimer (), Getitimer ()