From: Malcolm N. <m.n...@wa...> - 2004-12-29 11:03:37
|
Hello Eric, On 29 December 2004, 11:11:18, you wrote: > #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; > } This produces 1000 while(((ticks2-ticks1)/CLOCKS_PER_SEC)<1) ticks2=clock(); -- Best regards, Malcolm mailto:m.n...@wa... |