#include
#include
#include
#define NRUNS 1000
int main()
{
long h=0,i,j,k;
double d=0,pi = 4.0*atan(1.0);
time_t start,end;
printf("=====================================================\n");
printf("= Simple exection speed test - the*butler - Jan '09 =\n");
printf("=====================================================\n");
printf("Starting now ...");
start=clock();
for (i=0;i {
for (j=0;j {
for (k=0;k {
d+=sqrt(pi);
h++;
}
}
}
end=clock();
printf(" done. \n");
printf("h: %d \n", h);
printf("d: %f \n", d);
printf("Time (seconds): %15.3f \n", (double)(end-start)/CLOCKS_PER_SEC);
printf("=====================================================\n");
return 0;
}
Thursday, July 9, 2009
simple test for compiler speed
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment