Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: mogul@actitis.pa.dec.com (Jeffrey Mogul)
Subject: Re: Measuring time in OSF1 w/Alpha
Date: 1999/12/01	[thread overview]
Message-ID: <821uss$di4@usenet.pa.dec.com> (raw)
In-Reply-To: 8208a6$f8h$1@diable.upc.es

In article <8208a6$f8h$1@diable.upc.es>, oscarl@*remove-this*ac.upc.es (Oscar Laborda) writes:
|> I want to measure elapsed time in an OSF1 system with Alpha processor.
|> While routines like gettimeofday() and getclock() give time in ns,
|> the actual increments are of about 1ms, too bad for my purposes.
|> I would need increments of 10us or better.

Provided that you are using a recent version of Digital UNIX
or Tru64 (any Y2K-compliant version, and some older ones), you
can obtain microsecond-granularity values from gettimeofday().
See the FAQ:
	http://www.UNIX.digital.com/unix/faq/programming.html#P9
Note that this requires rebuilding the kernel (sorry, it wasn't
my decision!)

Also note that (depending on what CPU you are using, and various
other random variables) it might take longer than 1 uSec to
run gettimeofday(), so it's not necessarily accurate to 1 uSec.

This feature is also supposed to work properly on a multiprocessor.

|> I have also found the Alpha RPCC instruction, that gives increments in
|> 1 to 16 clocks (about ns), but the counter is 32bit and it would overflow
|> too fast.

As far as I know, RPCC increments once per clock tick on all existing
Alpha chips.  Some of these chips can execute multiple instructions
per clock tick, though.

-Jeff




  reply	other threads:[~1999-12-01  5:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-30  5:00 Measuring time in OSF1 w/Alpha Oscar Laborda
1999-12-01  5:00 ` Jeffrey Mogul [this message]
1999-12-01  5:00   ` Oscar Laborda
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