I'm doing a little experiment to test the speed difference between a C app and a Java app. I'm not sure what the best way is to display true speed. Should I have the apps perform certain calcs a number of times and find the difference in seconds? Here is what I have so far. It completes in about 50 seconds on my development box.
Display the speed of C.
long startTime, endingTime, totalTime;
void showTheSpeed(int loops)
startTime = time(NULL);
for(i = 0; i < loops; i++)
printf("%d \n", i);
endingTime = time(NULL);
totalTime = endingTime - startTime;
printf("Completed %d loops in %d seconds. \n", loops, totalTime);