diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 66c8c90ad..872c67d4c 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "8"; public const string Build = "3"; - public const string Revision = "3197"; + public const string Revision = "3199"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index a38098c58..477e31abb 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=8 -%REVISION%=3197 +%REVISION%=3199 %COREVERSION%=3 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index c28694524..b20c69f05 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.8.3.3197 +3.8.3.3199 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 442a83de9..e1e8dda6e 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.8.3.3197' +!define VERSION '3.8.3.3199' diff --git a/TestSuite/CompilationSamples/Utils.pas b/TestSuite/CompilationSamples/Utils.pas index ffbcce0da..9989fc1f5 100644 --- a/TestSuite/CompilationSamples/Utils.pas +++ b/TestSuite/CompilationSamples/Utils.pas @@ -1,4 +1,4 @@ -// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) unit Utils; @@ -10,6 +10,8 @@ function RecordToByteArray(obj : object): array of byte; procedure ShowMessage(msg: string); procedure ShowMessage(msg,capt: string); function GetFunctionPointer(fnc : Delegate) : integer; +/// Замеряет время работы процедуры p в миллисекундах. Производит n запусков и усредняет время работы +function Benchmark(p: procedure; n: integer := 100): real; implementation @@ -43,5 +45,15 @@ begin Result := System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(fnc).ToInt32; end; +function Benchmark(p: procedure; n: integer): real; +begin + var sw := new Stopwatch; + sw.Start; + loop n do + p; + sw.Stop; + Result := sw.ElapsedMilliseconds/n; +end; + begin end. \ No newline at end of file diff --git a/bin/Lib/Utils.pas b/bin/Lib/Utils.pas index ffbcce0da..9989fc1f5 100644 --- a/bin/Lib/Utils.pas +++ b/bin/Lib/Utils.pas @@ -1,4 +1,4 @@ -// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) unit Utils; @@ -10,6 +10,8 @@ function RecordToByteArray(obj : object): array of byte; procedure ShowMessage(msg: string); procedure ShowMessage(msg,capt: string); function GetFunctionPointer(fnc : Delegate) : integer; +/// Замеряет время работы процедуры p в миллисекундах. Производит n запусков и усредняет время работы +function Benchmark(p: procedure; n: integer := 100): real; implementation @@ -43,5 +45,15 @@ begin Result := System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(fnc).ToInt32; end; +function Benchmark(p: procedure; n: integer): real; +begin + var sw := new Stopwatch; + sw.Start; + loop n do + p; + sw.Stop; + Result := sw.ElapsedMilliseconds/n; +end; + begin end. \ No newline at end of file