//声明:
QueryPerformanceCounter(
  var lpPerformanceCount: TLargeInteger {获取定时器每秒的频率数; TLargeInteger = Int64}
): BOOL; {返回 False 表示调用失败, 或者是硬件不支持高性能定时器}

//一个有趣的示例: 判断你的鼠标点击速度; 我的最快记录是 151 毫米 var n1,n2,n,f: Int64; b: Boolean; procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin n := 0; b := not b; if b then QueryPerformanceCounter(n1) else begin QueryPerformanceCounter(n2); n := n2 - n1; end; if n<>0 then begin QueryPerformanceFrequency(f); n := n*1000 div f; Text := IntToStr(n) + ' ms'; end else Text := '等待第二下...'; end;

相关文章:

  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2021-05-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
相关资源
相似解决方案