From: mogul@pa.dec.com (Jeffrey Mogul)
Subject: Re: Alpha hw cycle counter
Date: 1996/06/06 [thread overview]
Message-ID: <4p5850$kab@usenet.pa.dec.com> (raw)
In-Reply-To: Pine.A32.3.93.960605112455.39137A-100000@spain.endicott.ibm.com
In article <Pine.A32.3.93.960605112455.39137A-100000@spain.endicott.ibm.com> Steve Thompson <v2pen01@spain.endicott.ibm.com> writes:
>I'm looking for a method to read the hw cycle counter under DEC Unix; C
>preferred but assembler OK. Alternatively, some way to read the current
>time to a resolution of at least a microsecond. I'd appreciate a pointer
>to either of these; TIA.
Create rpcc.s with this in it:
.globl ReadPCC
.ent ReadPCC,0
ReadPCC:;
.frame $30,0,$26
rpcc $0
ret $31,($26)
.end ReadPCC
Call it from C like so:
unsigned int p;
unsigned int ReadPCC();
p = ReadPCC();
works for me, anyway.
-Jeff
P.S.: Digital UNIX V4.0 will return microsecond resolution
from gettimeofday(), *if* you rebuild the kernel using the
MICROTIME configuration option. (Sorry, I haven't tried this
myself so I can't provide full instructions yet.)
prev parent reply other threads:[~1996-06-06 4:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-06-05 4:00 Alpha hw cycle counter Steve Thompson
1996-06-05 4:00 ` Dirk Grunwald
1996-06-06 4:00 ` Jeffrey Mogul [this message]
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