代码计算程序运行的时间
为了计算程序运行的时间
#include<bits/stdc++.h>
using namespace std;
#include<ctime>
void func1(){
int a[]={1,2,3};
do{
for (int i = 0; i <= 2; i++)
{
cout<<a[i]<<" ";
}
cout<<endl;
}while(next_permutation(a,a+3));
}
int main(){
clock_t start,end;
start=clock();
func1();
end=clock();
cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl;
}