16 ms - vorher über 2000 ms!
Delphi-Quellcode:
Function VariantToBytes(
Const Value: Variant): TBytes;
Var
Size: Integer;
pData: Pointer;
Begin
Size := Succ(VarArrayHighBound(Value, 1) - VarArrayLowBound(Value, 1));
SetLength(Result, Size);
pData := VarArrayLock(Value);
Try
Move(pData^, Pointer(Result)^, Size);
Finally
VarArrayUnlock(Value);
End;
End;
procedure TForm2.Button1Click(Sender: TObject);
var
bytestr : TBytesStream;
stamp1 : Integer;
stamp2 : Integer;
stamp3 : Integer;
// byte : Array of UInt8;
byte : TBytes;
begin
try
stamp1 := GetTickCount;
// byte := Ole;
byte:= VariantToBytes(
ole);
stamp2 := GetTickCount;
...