clock and timing.
Tom Davids
opentest@angelfire.com
Sun Oct 21 21:14:00 GMT 2001
I've just coded up this small program
#include <stdio.h>
#include <time.h>
main(){
clock_t start, stop, total;
int count;
start = clock();
printf("%d\n", CLOCKS_PER_SEC);
for(count=0; count < 200000; count++);
stop = clock();
total=stop-start;
printf("total = %lu\n", total);
}
The CLOCKS_PER_SEC is 1000000,
When I run the program I get the either
total = 10000
total = 20000
or
total = 0.
Could someone explain what the numbers range so much when the CLOCKS_PER_SEC is so high.
Any help is highly apprieciated.
Thanks
Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/
More information about the Gcc-help
mailing list