busy looping in kernel, time question

Chris Torek chris at umcp-cs.UUCP
Fri Apr 18 05:58:33 AEST 1986


In article <234 at Shasta.ARPA> alex at lancelot writes:
>	Assume I want to busy loop in the kernel for 100 milliseconds, how
>many times (approx) should I go around a loop which increments an int?

In a 4BSD kernel, use the `DELAY' macro.  DELAY(n) takes approximately
n microseconds to complete:

	DELAY(100000);	/* 100 ms */

The actual delay is *very* approximate.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1415)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at mimsy.umd.edu



More information about the Comp.unix.wizards mailing list