time_after(9)
β¨ time_after(9) β¨
okay so bestie, welcome to the Kernel API Manual entry for time_after β yes that's the manual name, we're fancy now π
this whole page is literally just the kernel's way of asking "is a later than b?" and honestly? relatable.
πΈ NAME πΈ
time_after β returns true if the time a is after time b. that's it. that's the whole vibe. π
π¦ SYNOPSIS π¦
bool time_after (u64 a , u64 b );
look at her. so clean. so iconic. π
π ARGUMENTS π
aβ the first thing we're comparing, and it's au64. yes, specificallyu64, no cap.bβ the second thing we're comparing, also au64. they match, it's giving symmetry π«Ά
π DESCRIPTION π
so here's the tea: do this with <0 and >=0 to only test the sign of the result. like, only check the sign, nothing else β that's the whole trick.
and the compiler tea? a good compiler would generate better code for this (and a really good compiler wouldn't even care). gcc is currently neither π like not one, not the other, just out here being mid. fr fr.
π RETURN π
true if time a is after time b, otherwise false. simple as that, bestie. no surprises, no plot twists π
π₯ SEE ALSO π₯
kernel file: ./tools/sched_ext/include/scx/common.bpf.h β go read her, iykyk β
and the whole friend group:
RESIZABLE_ARRAY(9)MEMBER_VPTR(9)ARRAY_ELEM_PTR(9)__sink(9)time_delta(9)time_before(9)time_after_eq(9)time_before_eq(9)time_in_range(9)time_in_range_open(9)
ngl these are all gonna be on the exam and they're all just little time-comparison besties living their best lives πΈ
okay that's the page, mwah π she lives in ./tools/sched_ext/include/scx and she's stamped October 2026 β go forth and compare your u64s responsibly, main character π§ββοΈ
π¦ 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