From: Eric <eri...@cl...> - 2004-12-29 10:11:55
|
#include<time.h> #include<stdio.h> int main(void) { clock_t ticks1, ticks2; ticks1=clock(); ticks2=ticks1; while((ticks2/CLOCKS_PER_SEC-ticks1/CLOCKS_PER_SEC)<1) ticks2=clock(); printf("Took %ld ticks to wait one second.\n",ticks2-ticks1); printf("This value should be the same as CLOCKS_PER_SEC which is %ld.\n",CLOCKS_PER_SEC); return 0; } /* I get 1050 or 1040 then 990 ticks most times it is 1040 */ /* sorry everyone, I must do more work */ |