This commit is contained in:
Ivan Bondarev 2022-11-02 20:18:25 +01:00
commit d2aaa2c9a2
6 changed files with 30 additions and 6 deletions

View file

@ -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;

View file

@ -1,4 +1,4 @@
%MINOR%=8
%REVISION%=3197
%REVISION%=3199
%COREVERSION%=3
%MAJOR%=3

View file

@ -1 +1 @@
3.8.3.3197
3.8.3.3199

View file

@ -1 +1 @@
!define VERSION '3.8.3.3197'
!define VERSION '3.8.3.3199'

View file

@ -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.

View file

@ -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.