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: 1164f8,6266f9f777efcf2d X-Google-Attributes: gid1164f8,public X-Google-Thread: 114b0c,6266f9f777efcf2d X-Google-Attributes: gid114b0c,public X-Google-Thread: f4871,6266f9f777efcf2d X-Google-Attributes: gidf4871,public X-Google-ArrivalTime: 1994-01-25 20:07:39 PST Xref: gmd.de comp.sys.sun.apps:6773 comp.sys.hp:28773 comp.parallel.pvm:1320 comp.sys.dec:13063 Path: gmd.de!xlink.net!howland.reston.ans.net!cs.utexas.edu!swrinde!emory!cs.utk.edu!thud.CS.UTK.EDU!manchek From: manchek@thud.CS.UTK.EDU (Bob Manchek) 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 18:42:51 GMT Organization: Computer Science Dept, University of Tennessee, Knoxville Distribution: world Message-ID: <2i3p7bINNa83@CS.UTK.EDU> References: <2hmq76INNd2e@flop.ENGR.ORST.EDU> NNTP-Posting-Host: thud.cs.utk.edu Here's a cheezy little program from back when I was writing the networking code. Just compile and run... /* * clockgran.c * * Demonstrate the granularity of the clock by sampling it * as fast as we can and saving the deltas. * * 10 Dec 1991 Manchek */ #include #include #include main() { struct timeval t1, t2; int del[200]; int i; gettimeofday(&t1, (struct timezone*)0); for (i = 0; i < 200; i++) { do { gettimeofday(&t2, (struct timezone*)0); } while (t2.tv_sec == t1.tv_sec && t2.tv_usec == t1.tv_usec); del[i] = (t2.tv_sec - t1.tv_sec) * 1000000 + t2.tv_usec - t1.tv_usec; t1 = t2; } for (i = 0; i < 200; i++) { printf("%8d", del[i]); } puts(""); exit(0); } -- / Robert Manchek University of Tennessee / / Computer Science Department / / (615)974-8295 Ayres Hall #104 / / manchek@CS.UTK.EDU. Knoxville TN 37996-1301 /