|
|
Thomas Willhalm wrote:
> Chris Huff <chr### [at] yahoocom> writes:
>
> > In article <qqm### [at] schlattfmiuni-konstanzde>, Thomas
> > Willhalm <tho### [at] willhalmde> wrote:
> >
> > > In frame.h it says:
> > > #define CLOCKDIVIDER CLK_TCK /*provided by standard c? */
> > > and as far as I know the answer is "No". According to the documentation
> > > available to me, you should use CLOCK_PER_SEC instead and include
> > > <time.h>.
> >
> > Actually, it is CLOCKS_PER_SEC. :-)
> > I don't know about whether it is standard or not, but I had to modify my
> > compile to use it instead of CLK_TCK. It took a bit of searching through
> > headers to find out about that annoying little "S".
>
> I'm sorry about wasting your time. I should have used copy'n'paste instead
> of typing.
>
> According to Plauger/Brodie "Standard C" CLOCKS_PER_SEC is standard.
> (Yes, I know that this book is from Microsoft Press, but let's assume
> that their books contain less errors than their software.)
According to the gcc time.h file, "CLK_TCK" is "the obsolete POSIX.1-1988
name for the same constant" for "CLOCKS_PER_SEC"
And here's the bit of code they use:
/* This defines CLOCKS_PER_SEC, which is the number of processor clock
ticks per second. */
# include <bits/time.h>
/* This is the obsolete POSIX.1-1988 name for the same constant. */
# ifdef __USE_POSIX
# ifndef CLK_TCK
# define CLK_TCK CLOCKS_PER_SEC
# endif
# endif
--
"My new computer's got the clocks, it rocks
But it was obsolete before I opened the box" - W.A.Y.
Post a reply to this message
|
|