- #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++计算程序运行时间
最新推荐文章于 2024-03-21 14:36:16 发布