标签:val linux 发送 setitimer seconds int span class which
/************************* *功能:获取时钟间隔 *参数:which:设置哪个时钟 * ITIMER_REAL:实时递减,超时发送SIGALRM信号 * ITIMER_VIRTURL:虚拟时钟,超时发送SIGVALRM时钟 * ITIMER_PROF: * **********************/ int getitimer(int which, struct itimerval *curr_value); /************************* *功能:设置时钟间隔 *参数:which:设置哪个时钟 * ITIMER_REAL:实时递减,超时发送SIGALRM信号 * ITIMER_VIRTURL:虚拟时钟,超时发送SIGVALRM时钟 * ITIMER_PROF: * new_value:新的时钟 * old_value:旧时间 * **********************/ int setitimer(int which, const struct itimerval *new_value,struct itimerval *old_value);
//时间赋值是原子操作 struct itimerval { struct timeval it_interval; /* next value */ struct timeval it_value; /* current value */ }; struct timeval { long tv_sec; /* seconds */ long tv_usec; /* microseconds */ };
linux高编信号-------setitimer()、getitimer()
标签:val linux 发送 setitimer seconds int span class which
原文地址:http://www.cnblogs.com/muzihuan/p/5310669.html