pascalabcnet/InstallerSamples/Other/SpeedTests/CalculationsGlobalLocal/GlobalVars.pas

18 lines
377 B
ObjectPascal
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Сравнение скорости работы глобальных и внутриблочных переменных.
// См. также файл BlockVars.pas
uses Utils;
var
s: real := 0;
i: real := 1;
begin
while i<10000000 do
begin
s += 1/i;
i += 1;
end;
writeln(s);
writeln('Время расчета = ',Milliseconds/1000,' с');
end.