c++学习笔记---测算程序运行时间

xiaoxiao2021-02-28  91

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; }
转载请注明原文地址: https://www.6miu.com/read-37828.html

最新回复(0)