From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,f4bababbaf26eab9 X-Google-Attributes: gidfee84,public From: mogul@actitis.pa.dec.com (Jeffrey Mogul) Subject: Re: Measuring time in OSF1 w/Alpha Date: 1999/12/01 Message-ID: <821uss$di4@usenet.pa.dec.com>#1/1 X-Deja-AN: 555116979 References: <8208a6$f8h$1@diable.upc.es> Organization: DEC Western Research Newsgroups: comp.unix.osf.osf1 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