Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在内核中,我想将 jiffies 与毫秒进行比较。我们可以在 if 语句中用 5 ms 做这样的事情吗?你能帮助我吗?
瞬间>5
来自include/linux/jiffies.h:
include/linux/jiffies.h
extern unsigned int jiffies_to_msecs(const unsigned long j);
如果它存在于您的内核中,请将 jiffies 转换为毫秒并根据需要进行比较:
#include <linux/jiffies.h> ... ... if (jiffies_to_msecs(jiffies)>5u) ....