下面是我的数据采集模块的代码,它的精度是1毫秒!能实现0.1毫秒吗?
procedure TCollectThread.Execute;
var
i : Integer;
lgTick1,lgTick2,lgPer:TLargeInteger;
fTemp:Single;
iTen:integer;
begin
QueryPerformanceFrequency(lgPer);
fTemp:=lgPer/1000;
iTen:=Trunc(fTemp);
QueryPerformanceCounter(lgTick1);
lgTick2:=lgTick1;
i:=Low(AArray);
while not Terminated do begin
if E_collect.WaitFor(INFINITE)=wrAbandoned then Exit;
While (i<=ArrayWidth) do begin //ArrayWidth=High(AArray);
QueryPerformanceCounter(lgTick2);
If lgTick2 - lgTick1 > iTen Then begin
lgTick1 := lgTick2;
AArray := ADIN; //采集数据
Inc(i);
end;
end;
end;
end;