⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.pas

📁 本源码是一个算法
💻 PAS
字号:
//----------------------
//单元名  :Test
//功能    :测试单元
//创建时间:2003.12.31
//作者    :zbird
//E-Mail  :zbird@etang.com
//----------------------
unit Test;

interface

uses
  Windows, SysUtils, Dialogs;

//统计执行代码所花费的时间
procedure startcount;
procedure endcount;

var
  lgTick1, lgTick2, lgPer: TLargeInteger; //计时用

implementation

procedure startcount;
begin
  QueryPerformanceFrequency(lgPer);     //每秒的震动次数
  lgPer := lgPer div 1000;              //每毫秒的震动次数
  QueryPerformanceCounter(lgTick1);     //系统频率记数器的震荡次数
end;

procedure endcount;
begin
  QueryPerformanceCounter(lgTick2);
  showmessage(inttostr((lgTick2 - lgTick1) div lgPer));
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -