转载自:http://blog.sina.com.cn/s/blog_a04184c101010kq6.html
标准库中无该函数,但在某些编译系统中有,在有些系统库中有,要根据你那边的环境而定。
如:
linux中有,unsigned int sleep(unsigned int seconds),传入挂起时间,成功返回0,不成功则返回余下的秒数。
windows系统中有Sleep函数(注意大写),void Sleep(DWORD dwMilliseconds); 提供挂起的毫秒数。
例如:
#include<iostream>
#include<windows.h>
using namespace std;
int main()
{
Sleep(3000);//暂停3秒 S要大写
return 0;
}