当前位置: 技术问答>linux和unix
定时器的小问题
来源: 互联网 发布时间:2015-07-21
本文导语: struct itimerval t; v.it_interval.tv_sec与v.it_value.tv_sec有什么区别 刚看内核,有问题就靠各位了 | man setitimer Timer values are defined by the following structures: struct itimerval...
struct itimerval t;
v.it_interval.tv_sec与v.it_value.tv_sec有什么区别
刚看内核,有问题就靠各位了
v.it_interval.tv_sec与v.it_value.tv_sec有什么区别
刚看内核,有问题就靠各位了
|
man setitimer
Timer values are defined by the following structures:
struct itimerval {
struct timeval it_interval; /* next value */
struct timeval it_value; /* current value */
};
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
Getitimer(2) fills the structure indicated by value with the current setting for
the timer indicated by which (one of ITIMER_REAL, ITIMER_VIRTUAL, or ITIMER_PROF).
The element it_value is set to the amount of time remaining on the timer, or zero
if the timer is disabled. Similarly, it_interval is set to the reset value.
Setitimer(2) sets the indicated timer to the value in value. If ovalue is nonzero,
the old value of the timer is stored there.
Timer values are defined by the following structures:
struct itimerval {
struct timeval it_interval; /* next value */
struct timeval it_value; /* current value */
};
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
Getitimer(2) fills the structure indicated by value with the current setting for
the timer indicated by which (one of ITIMER_REAL, ITIMER_VIRTUAL, or ITIMER_PROF).
The element it_value is set to the amount of time remaining on the timer, or zero
if the timer is disabled. Similarly, it_interval is set to the reset value.
Setitimer(2) sets the indicated timer to the value in value. If ovalue is nonzero,
the old value of the timer is stored there.