软讯网络 > 操作系统 > Linux > NS_TO_JIFFIES
【标 题】:NS_TO_JIFFIES
【关键字】:
NS_TO_JIFFIES
【来 源】:http://blog.csdn.net/kernel_details/archive/2007/01/09/1477835.aspx
NS_TO_JIFFIES

NS_TO_JIFFIES 将TIME(单位为纳秒)转换为时钟滴答数(1毫秒为一个滴答)
#define NS_TO_JIFFIES(TIME) ((TIME) / (1000 000 000 / HZ))
#define HZ 1000
例如:
TIME = 600ms
NS_TO_JIFFIES = 600ticks
600ms = 600 000 000ns
600 000 000 / 1000 000 000 / 1000 = 600(ticks)
【相关文章】
没有相关文章