QPX()

Author: SKAN Last Modified: 20091210


Calculates a high precision time difference in seconds. In example, could be used for benchmarking.

QPX( N=0 )

For the functions's parameters and return value, please see it's source code or the document.

Remarks

The function is very simple in usage, but it lacks an external documentation. So I wrote a simple one.

For update's details and remarks related to the functions, please see the AutoHotkey Forum: http://www.autohotkey.com/forum/viewtopic.php?t=52083

License

nonexistent

Example

; #Include QPX.ahk
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
SetBatchLines -1

;;** Basic Usage **
QPX( True )         ; Initialise Counter
Sleep 1000
Ti := QPX( False )  ; Retrieve Time consumed ( & reset internal vars )

MsgBox, 0, Sleep 1000, %Ti% seconds

;;** Extended Usage **
While QPX( 1000 )   ; Loops 1000 times and keeps internal track of the total time
 Tooltip %A_Index%
Ti := QPX()      ; Retrieve Avg time consumed per iteration ( & reset internal vars )

MsgBox, 0, Avg Time Taken for ToolTip, %Ti% Seconds / Iteration