Mail Archives: djgpp/1995/10/16/18:13:10
In article <19951013163056 DOT olly AT mantis DOT co DOT uk> Olly Betts writes:
> >>I *think* that CLOCKS_PER_SEC is an old alternative name for CLK_TCK,so they
> >>should be the same if both are defined. I may be wrong though.
> >
> >No, CLOCKS_PER_SEC is an ANSI C constant, from <time.h> (See K&R,2nd, p.255).
> >clock()/CLOCKS_PER_SEC returns the processor time used by the program,
> >in seconds, since the beginning of execution.
> >
> >CLK_TCK is PC only. You'd better avoid using it.
>
> We've a draft of the ANSI standard here (October 31, 1988) which says
> CLK_TCK is what you divide clock() by, though it's quite possible they
> changed it in the issued version of the standard (which I don't have access
> to currently).
>
> It's not as simple as "CLK_TCK is PC only" though.
max AT alcyone DOT darkside DOT com (Erik Max Francis) writes:
> > It's not as simple as "CLK_TCK is PC only" though.
> My copy of the ANSI C 1990 standard doesn't even mention CLK_TCK.
Perhaps we'd better take the upcoming ANSI C++ standard as a reference ?!?
You can browse through the 'April Working Paper' of the ANSI C++ standard at:
http://www.cygnus.com/~mrs/wp-draft/index.html
Here you'll find references to CLOCKS_PER_SEC in section 18.7, Table 5
[lib.support.runtime] and in annex C.4, Table 1 [diff.library].
CLK_TCK is not mentioned in this paper.
Pieter.
- Raw text -