From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,80cdc103b18508a6 X-Google-Attributes: gidfee84,public From: mogul@pa.dec.com (Jeffrey Mogul) Subject: Re: Alpha hw cycle counter Date: 1996/06/06 Message-ID: <4p5850$kab@usenet.pa.dec.com>#1/1 X-Deja-AN: 158683466 references: organization: DEC Western Research newsgroups: comp.unix.osf.osf1 In article Steve Thompson 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.)