procedure TZnThread.Create;
begin
FEvent := CreateEvent(nil, nil, nil);
end;
procedure TZnThread.Destroy;
begin
CloseHandle(FEvent);
end;
procedure TZnThread.Execute;
begin
while not Terminateddo
begin
if not WaitForSingleObject(FEvent, 1000) <> XX_TimeOut then
Exit;
Inc(FCounter);
if FCounter = 300 then
do
GetData;
if FCounter = 1000 then
do
SetData;
if Fcounter = 2000 then
do
CheckNet;
end;
end;