Skip to content

Instantly share code, notes, and snippets.

@JarvisPrestidge
Created April 23, 2019 20:51
Show Gist options
  • Save JarvisPrestidge/8cd6b22ec2e094fffccfc22a48740559 to your computer and use it in GitHub Desktop.
Save JarvisPrestidge/8cd6b22ec2e094fffccfc22a48740559 to your computer and use it in GitHub Desktop.
how to precisely profile a hotkey / function in AHK
*F10::
DllCall("QueryPerformanceFrequency", "Int64*", freq)
DllCall("QueryPerformanceCounter", "Int64*", CounterBefore)
<Call your code here>
DllCall("QueryPerformanceCounter", "Int64*", CounterAfter)
EllapsedMs := (CounterAfter - CounterBefore) / freq * 1000
MsgBox Elapsed QPC time is %EllapsedMs% ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment