源码天下

源码天下 -> 技术文档 -> 软件开发 -> Delphi开发 -> 文章内容

怎样得到查询所花费的时间



作者:佚名  来源:本站收集  发布时间:2008-5-10 22:07:10  发布人:wongrs

var
  iPos,iEnd,iTmp:Integer;
begin
  iPos:=GetTickCount;
  GetDataSet;
  iEnd:=GetTickCount;
  iTmp:=iEnd-ipos;
  stat1.SimpleText:='记录数:'+inttostr(qry1.RecordCount)+'条;耗时:'+inttostr(iTmp)+'毫秒';

 

使用getTickCount实现延时

procedure Delay(msecs:integer);
var
  FirstTickCount:longint;
begin
  FirstTickCount:=GetTickCount;
  repeat
  Application.ProcessMessages;
  until ((GetTickCount-FirstTickCount) >= Longint(msecs));
end;  


[] [返回上一页] [打 印] [收 藏]

上一篇文章:RemObjects SDK 简介
下一篇文章:SQL SERVER与ACCESS,EXCEL的数据转换
中国福网提供带宽支持