From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102b08,6266f9f777efcf2d X-Google-Attributes: gid102b08,public X-Google-Thread: f4871,6266f9f777efcf2d X-Google-Attributes: gidf4871,public X-Google-Thread: 1164f8,6266f9f777efcf2d X-Google-Attributes: gid1164f8,public X-Google-Thread: 114b0c,6266f9f777efcf2d X-Google-Attributes: gid114b0c,public X-Google-ArrivalTime: 1994-01-25 11:35:34 PST Xref: gmd.de comp.sys.sun.apps:6768 comp.sys.hp:28756 comp.parallel.pvm:1318 comp.sys.dec:13047 Path: gmd.de!xlink.net!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!decwrl!koriel!news2me.EBay.Sun.COM!exodus.Eng.Sun.COM!appserv.Eng.Sun.COM!cyber!barts From: barts@cyber.Eng.Sun.COM (Bart Smaalders) Newsgroups: comp.sys.sun.apps,comp.sys.hp,comp.parallel.pvm,comp.sys.dec Subject: Re: Accessing Real Time Clock in workstations (HPs, Suns, Dec Alphas) Date: 25 Jan 1994 08:08:21 GMT Organization: Sun Microsystems Inc., Mountain View, CA, USA Message-ID: References: <2hmq76INNd2e@flop.ENGR.ORST.EDU> NNTP-Posting-Host: cyber In-reply-to: ben@rex.uokhsc.edu's message of Mon, 24 Jan 1994 17:12:50 GMT 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.....