spark63
spark63

Reputation: 31

How to place microsecond delay in kernel?

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

Answers (2)

meuh
meuh

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

Arthur
Arthur

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

Related Questions