Kernel
會占住CPU,不讓CPU處理其他事,不適合長時間使用.
#include <linux/delay.h>
void mdelay(unsigned long msecs); //毫秒
void udelay(unsigned long msecs); //微秒
void ndelay(unsigned long msecs); //奈秒
●不忙碌等待(non-busy wait)
void mdelay(unsigned long msecs); //毫秒
void udelay(unsigned long msecs); //微秒
void ndelay(unsigned long msecs); //奈秒
●不忙碌等待(non-busy wait)
#include <linux/delay.h>
void ssleep(unsigned int seconds);
void msleep(unsigned int mecs);
unsigned long msleep_interruptible(unsigned int mecs);
void ssleep(unsigned int seconds);
void msleep(unsigned int mecs);
unsigned long msleep_interruptible(unsigned int mecs);