定时器的小问题

xiangye 2004-08-31 10:10:33
struct itimerval t;
v.it_interval.tv_sec与v.it_value.tv_sec有什么区别
刚看内核,有问题就靠各位了
...全文
131 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiangye 2004-09-01
  • 打赏
  • 举报
回复
3ku
xiangye 2004-09-01
  • 打赏
  • 举报
回复
3ku
xiangye 2004-09-01
  • 打赏
  • 举报
回复
3ku
gettext 2004-09-01
  • 打赏
  • 举报
回复
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.

4,465

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧