如何得知两个事件执行的时间间隔?(50分)

  • 主题发起人 esupermary
  • 开始时间
E

esupermary

Unregistered / Unconfirmed
GUEST, unregistred user!
我有两个事件,一个是BUTTON1CLICK,另一个是BUTTON2CLICK,我想知道我执行BUTTON1CLICK
后,又执行BUTTON2CLICK,两个事件的执行时间间隔。重点是要知道的时间是毫秒级的。
 
var
iCount: longint=0;//全局变量
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
iCount := GetTickCount;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
showmessage(IntToStr(GetTickCount-iCount));
end;
 
这只能得到秒级的,我要毫秒级的!谢谢!
 
GetTickCount,这就是毫秒级的啊。
 
同意 esupermary.
 
多人接受答案了。
 
[?]
GetTickCount不是毫秒级?下面是帮助

The GetTickCount function retrieves the number of milliseconds that have elapsed since Windows was started.
 
顶部