gettimeofday() function

I noticed that the gettimeofday() function prototype exists in
<sys/time.h> but the watcom linker does not find it in the libaries for
QNX 4.2.5, Watcom compiler 10.6. Does anyone know if this function is
supported by QNX 4.2.5??

If not, does anyone know how to get the time of day clock for timing
less than a second? I need to do some timing analysis and need finer
resolutions than a second.

Thanks in advance,
Rob Davidson

Rob Davidson <rdavidson@softwareremodeling.com> wrote:

I noticed that the gettimeofday() function prototype exists in
sys/time.h> but the watcom linker does not find it in the libaries for
QNX 4.2.5, Watcom compiler 10.6. Does anyone know if this function is
supported by QNX 4.2.5??

It’s in the “unix*.lib” library; … try linking with “-lunix”.

If not, does anyone know how to get the time of day clock for timing
less than a second? I need to do some timing analysis and need finer
resolutions than a second.

Refer to “clock_gettime()”.

Thanks!

I thought specifing the lib directory was enough but I guess not.
Also, I knew about clock_gettime(), but forgot. Thanks for jarring
my memory. One caveat though, if I remember correctly, clock_gettime is
affected by changes in the time on the system so should’nt be used in a
program that might be running when the system time is changed. For
my purposes, though it would work as well as gettimeofday().

Thanks again,
Rob


John Garvey wrote:

Rob Davidson <> rdavidson@softwareremodeling.com> > wrote:

I noticed that the gettimeofday() function prototype exists in
sys/time.h> but the watcom linker does not find it in the libaries for
QNX 4.2.5, Watcom compiler 10.6. Does anyone know if this function is
supported by QNX 4.2.5??


It’s in the “unix*.lib” library; … try linking with “-lunix”.


If not, does anyone know how to get the time of day clock for timing
less than a second? I need to do some timing analysis and need finer
resolutions than a second.


Refer to “clock_gettime()”.

Rob Davidson <rdavidson@softwareremodeling.com> wrote:

Also, I knew about clock_gettime(), but forgot. Thanks for jarring
my memory. One caveat though, if I remember correctly, clock_gettime is
affected by changes in the time on the system so should’nt be used in a
program that might be running when the system time is changed. For
my purposes, though it would work as well as gettimeofday().

The underlying primitive is clock_gettime(), so gettimeofday() will
be built on top of this (just dropping the nsecs into usecs when
turning a timespec into a timeval), so any such caveat will also apply.

try qnx_gettime() or sth like this (prototype in time or sys/time - try to
find in phothon’s help)



U¿ytkownik Rob Davidson <rdavidson@softwareremodeling.com> w wiadomooci do
grup dyskusyjnych napisa³:3C7BE958.8030203@softwareremodeling.com

I noticed that the gettimeofday() function prototype exists in
sys/time.h> but the watcom linker does not find it in the libaries for
QNX 4.2.5, Watcom compiler 10.6. Does anyone know if this function is
supported by QNX 4.2.5??

If not, does anyone know how to get the time of day clock for timing
less than a second? I need to do some timing analysis and need finer
resolutions than a second.

Thanks in advance,
Rob Davidson