Hi Sheldon,

Here is an answer and who did it..

RTAI and NMT RTL also have their own calls to do the same thing but I
thought ou would like the "raw" solution.

==========================code snip ==============================
// Uses code from:-
//           Andris Pavenis <[EMAIL PROTECTED]>
//                 to get the timer data
//
//
// cpu timer measurement
static inline long long rdtsc(void)
{
  long long time;
  __asm__ __volatile__( "rdtsc" : "=A" (time));
  return time;

}

and it is used thusly

 
  unsigned long long t1;
  t1 = rdtsc();   


Use the -O2 flag
   cc -O2 -o foo foo.c

============ end code snip ===================
You can also use the same solution inside a Real Time Module.


regards ,
   Phil Wilshire

   lineoISG ( formerly Zentropix )


>Sheldon Hoffman wrote:
> 
> <To [EMAIL PROTECTED]>
> 
> >    Date: Thu, 06 Jul 2000  04:27:41
> >    From: David Schleef <[EMAIL PROTECTED]>
> >
> >Time stamp _counter_ refers to the Pentium-internal counter,
> >which increments at the processor core frequency.  It can be
> >accessed much faster than the 8253 timers, is more accurate,
> >and overflows less often.
> 
> I would like to know how to access this "pentium internal counter".
> 
> Could someone please provide a reference to some code or a specific
> data sheet or other documentation (on the web?) for how to read
> this clock?
> 
> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> Shel Hoffman
> Reflective Computing
> 917 Alanson Dr
> St. Louis, MO 63132 USA
> (314) 993-6132 voice
> (314) 993-3316 fax
> [EMAIL PROTECTED]
> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> ---
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to