Re: rdtsc vs. GetTickCount()



At 15:41:08, 28.08.2005, Bruce McGee wrote:

> The following function (from the MM Challenge) does not compile in
> Delphi 5. Is it save to replace this with GetTickCount for
> compatibility, or will that cause problems?
>
> function GetCPUTicks: Int64;
> asm
> rdtsc;
> end;

GetTickCount will not give you the same number. It has a very, very
different granularity.

RDTSC was not known to the D5 compiler. You can probably emulate it with

asm
dw $310F
end;



--
Rudy Velthuis [TeamB] http://velthuis.homepage.t-online.de

"Never interrupt your enemy when he is making a mistake."
- Napoleon Bonaparte (1769-1821)
.



Relevant Pages

  • Re: XML-based object orientated pre-Assembler
    ... > I have been promising an object orientated ASM IDE for a while now. ... > that will parse XML code and output ASM files. ... > compile and viola, the code is ported. ... "Why would someone use this product over other assemblers?" ...
    (alt.lang.asm)
  • Re: 50% of packets lost only on local interfaces
    ... It would be quite interesting to compare the actual commands that ... Capture the buildworld/kernel output and compare ... There used to be inconsistencies in the way gcc handle asm() ... reported errors (and failed to compile the code). ...
    (freebsd-stable)
  • Re: pic c
    ... I'd call that 'C syntax Assembler', ... It isn't asm either. ... You still get tracking and optimization that C gives. ... The code will generally compile and run on other platforms. ...
    (comp.arch.embedded)
  • Re: Steganography MFC program problem...
    ... Asm is right that the 'i' variable is only in the scope of the for loop. ... I'm surprised it will even compile. ... Another trick is that you can turn off the new for scope "fix" in the project properties, but I recommend you fix the problem instead as it's really a better solution. ...
    (microsoft.public.vc.mfc)
  • Re: What micros do you actually hate to work with?
    ... register int16 thirteen; ... Would compile to the same assembly code. ... optimize the shift by a constant to a number of single shifts, ... with less than tiny asm ...
    (comp.arch.embedded)