Article View: comp.unix
Article #540Wanted For Sys V R3.0 : Gettimeofday() || milliseconds precision.
From: Dermot Tynan
Date: Mon, 20 Mar 1989 22:24
Date: Mon, 20 Mar 1989 22:24
39 lines
1832 bytes
1832 bytes
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).
Technical Details
Message-ID:
<8WhMbJy00V4F8HKl92@andrew.cmu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!apple!voder!pyramid!prls!mips!zorba!dtynanShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!apple!voder!pyramid!prls!mips!zorba!dtynan From: dtynan@zorba.Tynan.COM (Dermot Tynan) Newsgroups: comp.unix Subject: Wanted For Sys V R3.0 : Gettimeofday() || milliseconds precision. Message-ID: <8WhMbJy00V4F8HKl92@andrew.cmu.edu> Date: 20 Mar 89 22:24:00 GMT Organization: Tynan Computers, Sunnyvale, CA Lines: 39 Approved: dtynan@zorba.Tynan.COM