Hello to all. Could someone please say is it correct solution?

Hello to all. Could someone please say is it correct solution?

procedure TF_Main.Button1Click(Sender: TObject);
begin
Parallel.Async(
procedure
OmniControl1:= CreateTask(Task1, 'Task1');
OmniControl1.Run;

//wait 100 ms, if not finish - stop and nil
Milliseconds:= 100;
try
Tick := GetTickCount + DWord(Milliseconds);
while (Milliseconds > 0) and (Finised = False) do
begin
DSiProcessThreadMessages;
Milliseconds := Tick - GetTickcount;
end;
except
//
end;
//
if Finised = False then begin
Try OmniControl1.Stop; except end;
Try OmniControl1:= nil; except end;
Sleep(10);
end;

end);
end;

Comments