Re: CPU speed without rdtsc




Wojtek wrote:
Hi there!
I'm new here, so sorry if the question has appeared once :-)
I have to chceck speed of my CPU without using rdtsc. I wrote such code:
int _tmain(int argc, _TCHAR* argv[])
{
long long ile_operacji = 1000000000;
SYSTEMTIME st;
SYSTEMTIME st2;
GetSystemTime(&st);


You seem to be writing a Win32 app here, no?
If so, there is a kernel call you can make to get this information (off
the top of my head, I don't remember the API name, but I'm sure someone
else will follow up with that information).

RDTSC is becoming less and less reliable anyway. On multi-core CPUs,
different calls can return a different RDTSC counter value (if the
thread has switched affinity), so be aware of that.
Cheers,
Randy Hyde

.



Relevant Pages

  • Re: what exactly does CPU_TIME measure?
    ... clock cycles then rdtsc makes more sense. ... speed CPU) but clock cycles are. ... so you can get accurate timing even for small ...
    (comp.lang.fortran)
  • Re: Is timeGetTime monotonic and uniform?
    ... that returns the CPU ticks since boot time in EDX:EAX. ... Some time ago I read that when you get the RDTSC overhead (ie the time ... of checking whether the above recommendation is really necessary, ... forcing all other instructions out of the internal CPU ...
    (microsoft.public.win32.programmer.mmedia)
  • Re: Cpu speed without rdtsc
    ... I have to check speed of my CPU without using rdtsc. ... Hello Wojtek. ... One way might be to make a table of "nops per clock" for various processors. ... Of course, if using windows, you could just query the registry for the CPU ...
    (comp.lang.asm.x86)
  • Re: Whats the purpose of get_cycles_sync()
    ... Vojtech had one test that tested time monotonicity over CPUs ... I suspect the reason was because the CPU reordered the RDTSCs so that ... fit more than one iteration into the CPU's reordering window. ... What could have been happening then was that the RDTSC instruction might ...
    (Linux-Kernel)
  • Re: assembly in future C standard
    ... should the compiler author implement method 1 ... Some compilers will give an option to which set of cpu instruction ... complience with standard XX run on a cpu predated XX. ... Again ill use an example of RDTSC: ...
    (comp.lang.c)