From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,3feec7d54e23125e,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-07-14 12:28:11 PST Path: bga.com!news.sprintlink.net!hookup!swrinde!sdd.hp.com!nigel.msen.com!zib-berlin.de!informatik.tu-muenchen.de!regent!not-for-mail From: pak@regent.e-technik.tu-muenchen.de (Peter A Krauss) Newsgroups: comp.unix.osf.osf1 Subject: better real time clock resolution on Alpha? Date: 14 Jul 1994 20:46:42 +0200 Organization: Technical University of Munich, Germany Message-ID: <30416i$5lo@rebold.regent.e-technik.tu-muenchen.de> NNTP-Posting-Host: rebold.regent.e-technik.tu-muenchen.de How do I obtain a better real time clock resolution than 976 usec on a Alpha? Consider this program: ----------------------------------------------------- #include #define N 300 void main(void) { int i; struct timeval t[N]; for (i= 0; i < N; i++) gettimeofday(&(t[i]), NULL); for (i= 1; i < N; i++) printf("%3d: %d.%06d diff: %d\n", i, t[i].tv_sec, t[i].tv_usec, t[i].tv_usec - t[i - 1].tv_usec); } ----------------------------------------------------- ... 175: 774211062.325008 diff: 0 176: 774211062.325008 diff: 0 177: 774211062.325008 diff: 0 178: 774211062.325008 diff: 0 179: 774211062.325008 diff: 0 180: 774211062.325984 diff: 976 181: 774211062.325984 diff: 0 182: 774211062.325984 diff: 0 183: 774211062.325984 diff: 0 184: 774211062.325984 diff: 0 185: 774211062.325984 diff: 0 ... ----------------------------------------------------- I get many times the same value, and after 976 usec the clock advances to the next value. Is there any system call to obtain a better time resolution? mfg Peter -- Peter A. Krauss Peter.A.Krauss@regent.e-technik.tu-muenchen.de Lehrstuhl fuer Institute of Rechnergestuetztes Entwerfen Electronic Design Automation Technische Universitaet Muenchen Technical University of Munich, Germany