在xtime数据结构中
tv_nsec: 存储在最新的这秒内流逝的纳秒数。(值在0-999,999,999之间)
The xtime variable is usually updated once in a tickthat is, roughly
1000 times per second. As we'll see in the later section "System Calls
Related to Timing Measurements," user programs get the current time and
date from the xtime variable. The kernel also often refers to it, for
instance, when updating inode timestamps (see the section "File
Descriptor and Inode" in Chapter 1).
xtime 变量大约在一个时钟滴答(这个时间滴答是指从8253/8254中出来的中断)更新一次,大约每秒1000次。正如我们将要在和”时间测量有关的系统调用“见到的,用户程序得到当前的时间和日期从xtime变量中。kernel也引用它,例如,当更新节点的时间戳(见“文件描述符和节点“在第一章")
xtime变量更新的速度是如此的慢,精确到ns的数量级显然是靠的tsc。
在要求高精度的时间计算时,就是只和时钟滴答的时间精度有关了。
阅读(3230) | 评论(0) | 转发(0) |