[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

9513.0. "SYSTEM_COLCK equivenlent?" by SWAM1::POIANI_MI () Tue Apr 15 1997 21:55

    We're working with a customer to move them
    from SGI to Digital UNIX systems.  He's 
    attempting to implement a code that requires him
    to determine the number of clock cycles during
    a particular stage of code execution.  Under
    IRIX, he would invoke SYSTEM_CLOCK, which 
    returns an integer value.  Under
    Digital UNIX he's returned a null value.
    
    Is there such a routine for DU?
    
T.RTitleUserPersonal
Name
DateLines
9513.1Run the RPCC instructionSMURF::JPWJohn P Williams, DUDE, USG, 381-2079Wed Apr 16 1997 09:0216
From a C program:

main()
{
	unsigned long cc1, cc2;

	cc1 = asm("rpcc");

	... /* sequence to be timed */

	cc2 = asm("rpcc");
}

Don't try this in a program compiled -pthread.
See the Alpha SRM for info on how to interpret 
the two halves of the cycle counter quadword.
9513.2Ain't the process(or) cycle counter wonderful?...WTFN::SCALESDespair is appropriate and inevitable.Wed Apr 16 1997 16:119
.1> Don't try this in a program compiled -pthread.

Actually, it depends on what you're timing.  If you're doing in-process
counting, then yes, don't bother trying this with a threaded program on
V4.0x.  However, if you're doing system timing, then it should work fine with
threads (but not on a multiprocessor... :-).


				Webb