Reputation: 31
I want to place microsecond delay in Linux kernel
. Which functions supports it and what header file to be added for it?
Upvotes: 2
Views: 10119
Reputation: 12255
short sleeps are done by busy looping. they are to be discouraged. use udelay() but for no more than 1000 microseconds.
#include <linux/delay.h>
void udelay(unsigned long usecs);
Upvotes: 1
Reputation: 578
It's better for you to read Documentation/timers/timers-howto.txt
in linux kernel source code.
In brief, you can use msleep(unsigned long msecs)
whose header is linux/delay.h
Upvotes: 1