usecs_to_jiffies(9)
π usecs_to_jiffies (Kernel API Manual)
Ok so bestie, buckle up β this one lives in the Kernel API Manual and it's literally the glow-up translator for time units. It takes microseconds and turns them into jiffies. Slay.
β¨ NAME β¨
usecs_to_jiffies β convert microseconds to jiffies πβ‘οΈπ
πΈ SYNOPSIS πΈ
unsigned long usecs_to_jiffies (const unsigned int u );
π¦ ARGUMENTS π¦
uβ the time, in microseconds. That's it, that's the whole input. π
π DESCRIPTION π
So the conversion is done as follows, bestie β pay attention, this is the whole vibe:
MAX_JIFFY_OFFSETvalues] mean 'infinite timeout' too.- all other values are converted to jiffies by either multiplying the input value by a factor or dividing it with a factor and handling any 32-bit overflows as for
msecs_to_jiffies.
usecs_to_jiffies checks for the passed in value being a constant via __builtin_constant_p, which is honestly iconic of it β it lets gcc eliminate most of the code. π₯
Then __usecs_to_jiffies gets called if the value passed does not allow constant folding and the actual conversion must be done at runtime. And the HZ range specific helpers _usecs_to_jiffies are called both directly here and from __msecs_to_jiffies in the case where constant folding is not possible. The way this thing multitasks ππ
π RETURN π
The jiffies value. π«
π SEE ALSO π
Kernel file ./include/linux/jiffies.h, plus the whole friend group:
get_jiffies_64(9)- General information about
time_*inlines(9) time_after(9)time_before(9)time_after_eq(9)time_before_eq(9)time_in_range(9)time_in_range_open(9)time_after64(9)time_before64(9)time_after_eq64(9)time_before_eq64(9)time_in_range64(9)time_is_before_jiffies(9)time_is_before_jiffies64(9)time_is_after_jiffies(9)time_is_after_jiffies64(9)time_is_before_eq_jiffies(9)time_is_before_eq_jiffies64(9)time_is_after_eq_jiffies(9)time_is_after_eq_jiffies64(9)jiffies_to_msecs(9)jiffies_to_usecs(9)jiffies_to_nsecs(9)msecs_to_jiffies(9)secs_to_jiffies(9)
π«Ά Ok that's the whole page! This little gem comes from ./include/linux, dated October 2026, and it's filed under usecs_to_jiffies(9). Go forth and convert, bestie β no cap, you got this. πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms