C++,程序休眠,暂停1s

 

复制代码
#include <iostream>
#include <thread>
#include <chrono>
using namespace std;

int main()
{
    cout << "C++11" << endl;
    std::this_thread::sleep_for(std::chrono::milliseconds(100)); // 100ms
    std::this_thread::sleep_for(std::chrono::seconds(100));      // 100s

    cout << "C++14,支持字面量" << endl;
    std::this_thread::sleep_for(100ms);     // 100ms
    std::this_thread::sleep_for(100s);      // 100s

    return 0;
}
复制代码

 

posted @   十一的杂文录  阅读(145)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示