/*calculate time*/
#include "time.h"
#include "stdio.h"
#include "conio.h"
main()
{
time_t start,end;
int i;
start=time(NULL);
/*这里是程序其他代码*/
end=time(NULL);
printf("/1: The different is %6.3f/n",difftime(end,start));
getch();
}
=============================================
#include "time.h"
int main( void )
{
clock_t start, finish;
double usetime;
start = clock();
//这里写你测试程序
finish = clock();
usetime= (double)(finish - start) / CLOCKS_PER_SEC;
printf( "程序用时%f 秒/n", usetime);
}