C++跑程序所花时间

来源:互联网 发布:java工程师岗位总结 编辑:程序博客网 时间:2024/06/05 03:15
#include <ctime>#include <iostream>using namespace std;int main(){    clock_t s,f;    s=clock();    // Insert the code you want to calculate the total time.    f=clock();    double d=(double)(f-s)/CLOCKS_PER_SEC;    cout<<"The total time is: "<<d<<"s"<<endl;    return 0;}


代码如上:

0 0
原创粉丝点击