Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: neideck@kar.dec.com (Burkhard Neidecker-Lutz)
Subject: Re: How to find out clock frequency under DU ?
Date: 1997/03/24	[thread overview]
Message-ID: <5h61af$542@usenet.pa.dec.com> (raw)
In-Reply-To: 5gj3cd$idk@zam201.zam.kfa-juelich.de


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 <c_asm.h>

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




      reply	other threads:[~1997-03-24  5:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-17  5:00 How to find out clock frequency under DU ? A.Arnold
1997-03-24  5:00 ` Burkhard Neidecker-Lutz [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