Wanted For Sys V R3.0 : Gettimeofday() || milliseconds precision.

Dermot Tynan dtynan at zorba.Tynan.COM
Tue Mar 21 08:24:00 AEST 1989




I tried to post this message but it didn't appear on any of the board. So i'm
trying once again :

[Slight problem in transition - hopefully solved now  - Der]

Hello,
                   **** Excellent  Question For Unix Kernel
Wizards/Gurus/Hackers*****

I am trying for porting a RPC package (developed for BSD 4.2 Unix) to the
System V Rel 3.0 on
AT&T's 3B2/400 box:
I am stuck up with an equivalent code for the Gettimeofday() of BSD.
I have tried with getting time() and assigning micro seconds to 0. However,
this is creating lot of
problems to me : especially when the RPC server is  System V and client  is BSD
repectively
(and vice versa). This is due to BSD using timeouts in milliseconds where as
SysV using seconds.
One might suggest using times() call which gives 16msec precision. But that is
CPU usage time of the process not the time of the day.

Essentially my problem is: is there a way for a user level process to access
the time of the day in milli seonds.

Any working solutions are welcome. If some body could send me (e-mail)
alogorithm/code,
it would be of very much help and I would greatly appreciate.

Thanks much,

Murthy.
ps: there is another use for gettimeofday() : good source of randomizer (use
microseconds part
of the timeval, discard last byte and you get a reasonably good random number
over time).



More information about the Comp.unix mailing list