代码运行时间测试C++
生活随笔
收集整理的這篇文章主要介紹了
代码运行时间测试C++
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
代碼運行時間測試
#include<iostream.h>
#include<time.h>
void main()
{clock_t start,finish;double totaltime;start=clock();//下面你要測試的程序代碼運行時間
//代碼開始..........................
//代碼結束finish=clock();totaltime=(double)(finish-start)/CLOCKS_PER_SEC;cout<<"\n此程序的運行時間為"<<totaltime<<"秒!"<<endl;
}
?
總結
以上是生活随笔為你收集整理的代码运行时间测试C++的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Win10下VisualStudio20
- 下一篇: 不知道什么时间收集的code