Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

QueryPerformanceCounter() example


  • Please log in to reply
No replies to this topic
iPhilip
  • Members
  • 138 posts
  • Last active: Sep 12 2015 06:27 PM
  • Joined: 03 Jun 2010

The documentation pages for DllCall() (http://www.autohotke...nds/DllCall.htm and http://ahkscript.org...ds/DllCall.htm) contain an example for QueryPerformanceCounter() which I would like to see modified to make it more useful for users, especially early users of AutoHotkey. I would recommend the following:
 

DllCall("QueryPerformanceCounter", "Int64*", CounterBefore)
Sleep 1000
DllCall("QueryPerformanceCounter", "Int64*", CounterAfter)
DllCall("QueryPerformanceFrequency", "Int64*", Frequency)
MsgBox % "Elapsed QPC time is " . (CounterAfter - CounterBefore)*1000/Frequency . " milliseconds"

iPhilip


Windows 7 Pro (64 bit) - AutoHotkey v1.1+ (Unicode 32-bit)