c++统计for运行时间
1 #include<bits/stdc++.h> 2 using namespace std; 3 int main(){ 4 int i,k,n = 1e9; 5 clock_t start,end; 6 start = clock(); 7 for(i=0;i<n;i++)k++; 8 end=clock(); 9 cout<<(double)(end -start)/CLOCKS_PER_SEC<<endl; 10 return 0; 11 }

本文来自博客园,作者:guoyuxin3,转载请注明原文链接:https://www.cnblogs.com/guoyuxin3/p/15096770.html

浙公网安备 33010602011771号