Mail Archives: djgpp/1996/06/06/00:07:09
Thinking furiously, blah wrote:
> int main(void)
> {
> clock_t start, end;
> start = clock();
> end = clock();
> printf("The time was: %f\n", (end - start) / CLK_TCK);
> return 0;
> }
>
> When i run this after compiling in gcc it always prints 0.00000!
>
> any ideas?
Yes. (end-start)/CLK_TCK is an integral type, not a float.
--
-------------------------------------------------------------------------------
.---- Fred Smith / Office: fred AT computrition DOT com
( /__ ,__. __ __ / __ : / 508-663-2524
/ / / /__) / / /__) .+' Home: fredex AT fcshome DOT stoneham DOT ma DOT us
/ / (__ (___ (__(_ (___ / :__ 617-438-5471
-------------------------------- Jude 1:24,25 ---------------------------------
- Raw text -