Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: barts@cyber.Eng.Sun.COM (Bart Smaalders)
Subject: Re: Accessing Real Time Clock in workstations (HPs, Suns, Dec Alphas)
Date: 25 Jan 1994 08:08:21 GMT	[thread overview]
Message-ID: <mk9krlINNna0@appserv.Eng.Sun.COM> (raw)
In-Reply-To: ben@rex.uokhsc.edu's message of Mon, 24 Jan 1994 17:12:50 GMT



<Someone is looking for a hardware timer and doesn't believe Solaris 2.[23]
 gettimeofday is adequate>

Gettimeoday(2) is implemented as a fast trap since Solaris 2.2.  As a result, 
this call takes about 2->3 microseconds on a SS10 (slightly more on an SS2).
It returns answers accurate to the resolution of the hardware clock (1 microsecond
on 4[cmd] platforms).

Please remember to allow for clock ticks when interpreting data obtained
via this call.  In addition, any skewing of the clock to adjust time gradually will
appear in these values.  

Since one test is often worth 1000 expert opinions, I wrote a small program
to make 10000 calls in a loop to gettimeofday, and afterward computed min
time between samples and mean time between samples.  I ran it until I missed
the clock ticks and other apps.

All times in seconds.

On SS10 M51 running the next release of Solaris:  

min = .000002, mean = .000003

On HP 9000/755 running HP-UX A.09.01 C:

min = .000017, mean = .000021

I've forgotten the orignal thread, but this should probably be adequate for most
purposes.  Remember that these clocks are often slow to read in hardware, let
alone software.

- Bart Smaalders

CDE performance


My opinions, etc.....











  reply	other threads:[~1994-01-25  8:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-01-20 20:40 Accessing Real Time Clock in workstations (HPs, Suns, Dec Alphas) NeoSwami
1994-01-20 21:42 ` Paul Gootherts
1994-01-21 12:23   ` Kell S|nnichsen
1994-01-21 15:48   ` john.j.rushford..jr
1994-01-21 19:25     ` Guy Harris
1994-01-24 17:12   ` Benjamin Z. Goldsteen
1994-01-25  8:08     ` Bart Smaalders [this message]
1994-01-25 18:42       ` Bob Manchek
1994-01-26  0:57       ` Doug Siebert
1994-01-26  8:11         ` Casper H.S. Dik
1994-01-27  4:07         ` Greg Limes
1994-01-29  5:07       ` mark hahn
1994-01-21 16:59 ` Bart Smaalders
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox