C++程序运行时间测试代码

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

int main()
{
    clock_t start = clock();

    //测试块-----------

    //自己程序放入

    //------------

    clock_t ends = clock();
    cout <<"Running Time : "<<(double)(ends - start)/ CLOCKS_PER_SEC << endl;
    return 0;
}


猜你喜欢

转载自blog.csdn.net/weixin_42513339/article/details/89208922