linux下的sleep函数原型为: unsigned int sleep(unsigned int seconds); 注:线程必须是分离状态哦 使用gcc的库,sleep()函数是以秒为单位的,sleep(1);就是休眠1秒。