C++查看运行时间

参考链接:https://www.cnblogs.com/dwdxdy/p/3214905.html

#include <iostream>
#include <ctime>
#include <cstdlib>
#include <Windows.h>
#include <vector>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <functional>
#include <random>       // std::default_random_engine
#include <chrono>       // std::chrono::system_clock
 
using namespace std;
 
int main(){
    double dur;
    clock_t start,end;
    start = clock();
    Sleep(1000); 
    end = clock();
    dur = (double)(end - start);
    printf("Use Time:%f\n",(dur/CLOCKS_PER_SEC));
}

猜你喜欢

转载自blog.csdn.net/qq_36974075/article/details/84000640