Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: Timing in Linux and 686 Cache



On Sat, Jul 18, 1998 at 06:30:23PM +0900, Manuel Chakravarty wrote:
> * Does anybody have an idea whether it is possible in Linux to time the
>   execution of user-level code below a resolution of 10ms?  Using the function
>   `getrusage', a resolution of 10ms is the best that I can get.  Is there
>   anything better?

On Pentiums and above, you can use the RDTSC instruction to get a 64bit
count of the number of clock cycles the processor has seen.

http://developer.intel.com/drg/pentiumII/appnotes/RDTSCPM1.HTM

The app note has some suggestions with dealing with the out-of-order
execution that happens on PentiumPro and PentiumII processors.

(DJ Bernstein's clockspeed includes an example of reading this
register.   http://pobox.com/~djb/clockspeed.html)

-- 
Jim Tittsler, Tokyo   ICQ: 5981586

--------------------------------------------------------------
Next Nomikai: 17 July, 19:30 Tengu TokyoEkiMae 03-3275-3691
Next Meeting: 8 August, Tokyo Station Yaesu central gate 12:30
featuring Linux on multiple platforms:
i386, Sparc, PA-Risc, Amiga, SGI, Alpha, PalmPilot, ...
--------------------------------------------------------------
Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links