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 我的电脑连接到 internet 了吗?

Delphi vcl 鼠标左键长按功能的实现

Delphi 中相对路径与绝对路径函数说明

Delphi 获取cpuid的函数

Delphi 获取计算机从开机开始的已运行时间

Delphi 10.3.x 截取字符串函数substring 和copy()常用字串符处理函数用法

Delphi编写你的第一个com程序

Delphi xe10 手机端错误提示:detected problems with api compatibility (visit g.co/dev/appcompat for more info

Delphi restfull api调用方法

Delphi 10 seattle的android应用程序中使用参数启动服务

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



打赏

取消

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

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

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

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

评论

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