C++跑程序所花时间

    xiaoxiao2025-02-04  10

    #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; }

    代码如上:

    转载请注明原文地址: https://ju.6miu.com/read-1296098.html
    最新回复(0)