#include <conio.h>
#include <stdio.h>
#include<time.h>
double multi();
void main()
{
clrscr();
clock_t start = clock();
for (int i = 0; i < 1000; i++)
{
multi();
//printf("Answer (%d)",s);
}
clock_t end = clock();
float diff;
diff = (float) (end - start) / CLOCKS_PER_SEC;
printf("time execution :%f", diff);
getch();
}
double multi()
{
double a;
a = 5 * 5;
return a;
}
执行时间显示为 0.000000 什么问题!
会不会是 nanoseconeds 的原因