Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: pak@regent.e-technik.tu-muenchen.de (Peter A Krauss)
Subject: better real time clock resolution on Alpha?
Date: 14 Jul 1994 20:46:42 +0200	[thread overview]
Message-ID: <30416i$5lo@rebold.regent.e-technik.tu-muenchen.de> (raw)


How do I obtain a better real time clock resolution
than 976 usec on a Alpha?

Consider this program:
-----------------------------------------------------
#include <sys/time.h>

#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


             reply	other threads:[~1994-07-14 18:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-07-14 18:46 Peter A Krauss [this message]
1994-07-18  8:27 ` better real time clock resolution on Alpha? Sebastian Schmidt
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