Delphi 计算运行耗时的方法2


本文整理自网络,侵删。

 
private
    lStart : Longint;
    lEnd : Longint;
 
    procedure GetStartTime;
    procedure GetEndTime;
    function GetRunTimes : Double;
public

end;
  
/////////////////////

procedure GetEndTime;
begin
  lEnd := GetTickCount;
end;
 
function GetRunTimes: Double;
begin
  Result := (lEnd - lStart) / 1000.0;
end;
 
procedure GetStartTime;
begin
  lStart := GetTickCount;
end;

//用法
GetStartTime;
//代码片段
GetEndTime;

edit1.Text := FloatToStr(GetRunTimes); 


Delphi 计算运行耗时的方法1
http://www.delphitop.com/html/shijian/4340.html

相关阅读 >>

Delphi版内存共享

Delphi 用ado从文本文件中导入数据库的两种方法比较

Delphi xe10 麦克风、摄像头操作

Delphi 关于选择文件路径 selectdirectory 弹出窗口居中的问题

Delphi memo 循环往上往下滚动

Delphi xe8 androdi利用httpclient实现的一个app自动更新组件

Delphi sendmessage这个函数有很多奇妙的用途

Delphi 如何快速读写文件中的字符串

Delphi webbrowser 自动登录

Delphi 截屏函数(包含截取鼠标形状)

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...