DELAY(9)

πŸ“¦
version 11.0 Β· 2 versions
, in nixpkgs unstable

🌸 NAME 🌸

okay so bestie, welcome to DELAY(9) β€” it's the Kernel Developer's Manual page for delay and DELAY, and it's literally the microsecond delay page πŸ’…. No cap, that's the whole vibe.


✨ SYNOPSIS ✨

#include <sys/param.h>

void
delay(unsigned int us);

void
DELAY(unsigned int us);

πŸ’« DESCRIPTION πŸ’«

So delay() and DELAY() wait approximately us microseconds. That's the tea β˜•.

The delay is implemented as a machine loop, preventing events other than interrupt handlers for unmasked interrupts to run. Yes, that is the exact energy β€” a little busy-loop moment, but make it kernel ✨.

DELAY() is reentrant (doesn't modify any global kernel or machine state) and is safe to use in interrupt or process context. Highkey important, bestie 🫢.

For long delays, condition variables should be considered, however they can only be used from process context and their resolution is limited by the system clock frequency. So like… for the long-haul waits, look at condition variables, but respect the process-context-only rule and the clock-frequency limit, periodt πŸ’….


πŸŽ€ SEE ALSO πŸŽ€


k bye bestie πŸ¦‹πŸ’– this lil icon is from Debian, dated July 20, 2011, and yes it's DELAY(9) β€” mwah πŸ’‹πŸ‘‘

πŸ“¦ where this page comes from