100000000 times Sum and Sum(Sqrt).
uses
SysUtils;
var
i: Integer;
dTime: Cardinal;
f: Extended;
i64: Int64;
begin
f := 0.0;
i64 := 0;
dTime := GetTickCount;
for i := 0 to 100000000 - 1 do
begin
i64 := i64 + i;
f := f + Sqrt(i);
end;
dTime := GetTickCount - dTime;
println Format('Elapsed %d ms. Result=%d, SumSqrt=%.8f', [dTime, i64, f]);
end;
?>