linux中的延时
2015-08-10 17:41
357 查看
应用层: (use "man" for help)
#include <unistd.h>
1、unsigned int sleep(unsigned int seconds); 秒级
2、int usleep(useconds_t usec); 微秒级:1/10^-6 (usec范围:1——1000000)
#define _POSIX_C_SOURCE 199309
#include <time.h>
3、int nanosleep(const struct timespec *req, struct timespec *rem);
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
// The value of the nanoseconds field must be in the range 0 to 999999999.
内核层:
include <linux/delay.h>
1、void ndelay(unsigned long nsecs); 纳秒级:1/10^-10
2、void udelay(unsigned long usecs); 微秒级: 1/10^-6
3、void mdelay(unsigned long msecs); 毫秒级:1/10^-3
#include <unistd.h>
1、unsigned int sleep(unsigned int seconds); 秒级
2、int usleep(useconds_t usec); 微秒级:1/10^-6 (usec范围:1——1000000)
#define _POSIX_C_SOURCE 199309
#include <time.h>
3、int nanosleep(const struct timespec *req, struct timespec *rem);
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
// The value of the nanoseconds field must be in the range 0 to 999999999.
内核层:
include <linux/delay.h>
1、void ndelay(unsigned long nsecs); 纳秒级:1/10^-10
2、void udelay(unsigned long usecs); 微秒级: 1/10^-6
3、void mdelay(unsigned long msecs); 毫秒级:1/10^-3
相关文章推荐
- Linux system log avahi-daemon[3733]: Invalid query packet
- 性能测试工具curl-loader(linux)
- Linux操作系统文件系统基础知识详解
- Linux常用命令(更新中)
- windows 平台开发的JSP程序上传到linux要注意的事项
- Linux系统下的用户审计方法
- CentOS下安装配置PPTP ***服务器
- CentOS/SMTP服务器的构建
- Linux修改/etc/profile不生效的问题
- linux.6.5+cacti.0.8.7. 的安装记录
- Linux Bonding配置详解
- linux3.2.0块设备及nandflash驱动框架
- Bridging and Bonding with CentOS 6.5
- Your CPU does not support long mode. Use a 32 bit distribution.
- Linux下testlink安装
- CentOS 下安装testlink
- linux mount (挂载命令)详解
- 7个免费的Linux FTP客户端工具
- CentOS查看端口是否被占用
- CentOS查看端口是否被占用