C++ Sleep Function 使用方法 Sleep(-1)

<span style="font-size:18px;">//============================================================================
// Name        : TestSleepFunction.cpp
// Author      :
// Version     :
// Copyright   : 2014
// Description : Test Sleep Function in C++, Ansi-style
//============================================================================

#include <iostream>
#include <unistd.h>
using namespace std;

int main() {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	//1 sec=1000 milliseconds
	sleep(10);//
	//sleep(-1);//sleep 无限时间
	cout<<"Sleep"<<endl;
	return 0;
}</span>

原文地址:https://www.cnblogs.com/mthoutai/p/6906076.html