#include <stdio.h>
#include <time.h>
clock_t start,stop;
double duration;
void printN(int n)
{
int i=0;
if(n)
{
printN(n-1);
printf("%d ",n);
}
}
int main()
{
start = clock();
//测试程序
printN(100000);
stop = clock();
duration = (double)(stop - start)/CLK_TCK;
printf("\n%lf",duration);
return 0;
}
程序时间测试
最新推荐文章于 2021-09-12 07:32:33 发布