Hi.
I tested that function, and strangely it takes 2640ms.
The same function made in plain Delphi takes 2235ms.
I put a screenshot here but I think this email list is plain text and it 
won't  be shown.

I reason may be:
1. Delphi compiler is great and it creates 100% efficient code
2. I used a wrong testing method.

I used this to compare the time:

procedure TForm1.Button6Click(Sender: TObject);
VAR i, Big: integer;
    T: Cardinal;
begin
 Label8.Caption:= '';
 T:= GetTickCount;
 for i:= 1 to 1000000000 DO   { 100 milioane }
  begin
   Max2(random(1000), random(1000));
  end;
 Label8.Caption:= IntToStr(GetTickCount-T);
end;




Wilfried Mestdagh wrote:
> Hello,
>
> Oeps I wrote a bug in the Max3. This one is better:
>
> function Max3(a, b, c: integer): integer;
> asm
>    cmp eax, edx
>    jl  @less
>    mov edx, ecx
>    jmp @again
> @less:
>    mov eax, ecx
> @again:
>    cmp eax, edx
>    jl  @done
>    ret
> @done:
>    mov eax, edx
> end;
>
> ---
> Rgds, Wilfried
> http://www.mestdagh.biz
>
> _______________________________________________
> Delphi mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi
>
>   
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to