testsharemem.dpr

来自「Sharemem replacement for Delphi. Fast, 」· DPR 代码 · 共 25 行

DPR
25
字号
program TestShareMem;

{$APPTYPE CONSOLE}

uses
  QMemory,      // <-- Must be the first unit in the uses clause. Use in calling program only and NOT IN DLL!
                // <-- QMemory is 20% faster than Delphi's MemMgr
  ShareMemRep;

function AllocSpeedTest : LongWord;
  external 'TestDll.dll';
function SequentialAllocTest : LongWord;
  external 'TestDll.dll';
function ThreadAllocTest : LongWord;
  external 'TestDll.dll';

begin
  Writeln('Allocate 1000 random blocks of (4097 .. 10000) bytes 1000 times');
  Writeln('Time: ', AllocSpeedTest, ' ms, ok.');

  Writeln;
  Writeln('10 Threads Allocated');
  Writeln('Time: ', ThreadAllocTest, ' ms, ok.');
end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?