This usually works well enough for single platforms. Keep in mind
that the definition may vary by platform.
Off-Topic: I never found the clock tick definitions (at least under
linux) to make much sense; how could a hard-coded divisor possibly
represent anything related to timing when the underlying hardware
might have a speed within a wide range of possibilities?
On Feb 29, 2008, at 9:04 AM, Paul Loy wrote:
Whenever I get anything like this, I simply grep the header files.
i.e.:
grep -R _SC_CLK_TCK /usr/include/*
/usr/include/unistd.h:#define _SC_CLK_TCK 3
so, 3 is the answer!
Paul.
On Fri, Feb 29, 2008 at 11:32 AM, Alexandru Popescu ☀
<the.mindstorm.mailinglist@gmail.c
om> wrote:
Hi all!
I'm very new to using JNA (and in general to interfacing Java with C
-- I guess there are quite a few years since I've done this the last
time).
Right now I am trying to map the sys/times.h clock_t times(struct tms
*) call. According to the documentation the returned values are
measured in number of clock ticks per second, and to figure out what
this value is I should be calling the function long sysconf(int) where
the parameter should be _SC_CLK_TCK.
My problem is that I don't have any idea about the value of
_SC_CLK_TCK, so I am pretty lost on how it would be possible for me to
get the sysconf invocation working.
Any ideas? Many thanks in advance,
./alex