其他语言

位置:IT落伍者 >> 其他语言 >> 浏览文章

利用Delphi建立精确计数器[2]


发布日期:2018年10月16日
 
利用Delphi建立精确计数器[2]

下面是具体的检测程序

unit Unit;

interface

uses

Windows Messages SysUtils Classes Graphics Controls Forms Dialogs

StdCtrls ExtCtrlsmmSystem;

type

TForm = class(TForm)

Edit: TEdit;

Edit: TEdit;

Edit: TEdit;

Button: TButton;

Button: TButton;

Timer: TTimer;

procedure FormCreate(Sender: TObject);

procedure ButtonClick(Sender: TObject);

procedure TimerTimer(Sender: TObject);

procedure ButtonClick(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form: TForm;

actTimeactTime:Cardinal;

smmCountsTimerCountsPCount:Single;

hTimeID:Integer;

iTen:Integer;

proTimeCallBack:TFNTimeCallBack;

procedure TimeProc(uTimerID uMessage: UINT;

dwUser dw dw: DWORD) stdcall;

procedure proEndCount;

implementation

{$R *DFM}

//timeSetEvent的回调函数

procedure proEndCount;

begin

actTime:=GetTickCountactTime;

FormButtonEnabled :=False;

FormButtonEnabled :=TRue;

FormTimerEnabled :=False;

smmCount:=;

sTimerCount:=;

spCount:=;

timeKillEvent(hTimeID);

end;

[] [] [] []

               

上一篇:利用Delphi建立精确计数器[3]

下一篇:利用Delphi建立精确计数器[1]