#include<stdio.h>
#include<time.h>
#include<math.h>
clock_t start,stop; //包含在time.h头文件中
double duration;
#define MAXN 10
int main()
{
int i;
double a[MAXN];
start=clock(); //开始的时间
//中间写入要计算时间的代码
stop=clock(); //结束的时间
duration=((double)(stop-start))/CLK_TCK;
//TC2.0中CLK_TCK的值是18.2
//VC6.0中中类似的有CLOCKS_PER_SEC,值为1000
printf("%2.6lf\n",duration);
return 0;
}