Re: rdtsc

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

 



If you really need full 64-bit counter, Create a type of union between two 32-bit values and a 64-bit value. You can do addition and subtraction between 64-bit values. For averages, try using powers of two for N samples and then use shr on the 64-bit value to derive an average. 
 
You could also use the 32-bit equivalent of rtdsc if you don't need to deal with too many ticks between samples.
 
Stuart
 
----- Original Message -----
Sent: Saturday, May 27, 2006 16:32
Subject: rdtsc

Hi,

I'm using rdtsc to take some time stamps. rdtsc uses two long values to store a 64 bit value.

How can I convert this two long to a long long? for example:

rdtsc(t1l,t1h);

...
...

rdtsc(t2l,t2h);

And now, I want to substract the values to get the interval of time in clock ticks.

Thanks in advance

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux