From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,94c57d6f42aba90b X-Google-Attributes: gid1164f8,public From: neideck@kar.dec.com (Burkhard Neidecker-Lutz) Subject: Re: How to find out clock frequency under DU ? Date: 1997/03/24 Message-ID: <5h61af$542@usenet.pa.dec.com>#1/1 X-Deja-AN: 227962493 Distribution: world References: <5gj3cd$idk@zam201.zam.kfa-juelich.de> Organization: CEC Karlsruhe Newsgroups: comp.sys.dec In article <5gj3cd$idk@zam201.zam.kfa-juelich.de> a.arnold@kfa-juelich.de writes: > >On an AlphaStation running Digital Unix, is there a way for a C program to find >out the processor's clock speed? #include main() { unsigned int start, finish, count = 0; start = asm("rpcc %v0"); count -= start; sleep(1); finish = asm("rpcc %v0"); count += finish + 500000; count /= 1000000; printf("CPU is %d Mhz\n", (int) count); } Burkhard Neidecker-Lutz CEC Karlsruhe , European Applied Research Center, Digital Equip. Corp. email: neideck@kar.dec.com 433Mhz 21164, 64 MB RAM, 2.1 GB SCSI, SPEC95 12.6e/12.0e, Linux preinstalled Just $4630,, See http://www.swt.com/alpha_linux.html for details