#include <time.h>
#include <stdio.h>
#include <conio.h>
int main()
{
clock_t t_begin,t_end;
//代码1开始计时
t_begin=clock();
//
//你的程序段1
//
t_end=clock();
printf("代码1所用的时间:%.3f秒/n",(double)(t_end-t_begin)/CLOCKS_PER_SEC);
//代码2开始计时
t_begin=clock();
//
//你的程序段2
//
t_end=clock();
printf("代码2所用的时间:%.3f秒/n",(double)(t_end-t_begin)/CLOCKS_PER_SEC);
getch();
return 0;
}