⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 figc.12

📁 unix环境高级编程第二版配套源代码 unix环境高级编程第二版配套源代码
💻 12
字号:
#include <unistd.h>#include <time.h>#include <sys/select.h>unsignedsleep(unsigned nsec){	int n;	unsigned slept;	time_t start, end;	struct timeval tv;	tv.tv_sec = nsec;	tv.tv_usec = 0;	time(&start);	n = select(0, NULL, NULL, NULL, &tv);	if (n == 0)		return(0);	time(&end);	slept = end - start;	if (slept >= nsec)		return(0);	return(nsec - slept);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -