Someone posted this function which is accurate down to '100th of a ms'
Code: Select all
delay(time)
{
DllCall("QueryPerformanceFrequency", "Int64*", freq)
DllCall("QueryPerformanceCounter", "Int64*", countatstart)
; sleep, % (time - 15)
loop,
{
DllCall("QueryPerformanceCounter", "Int64*", countrnow)
timepassed := ((countrnow - countatstart) / freq )*1000
if (timepassed > time)
{
break
}
}
; ToolTip, % timepassed, 100, 100, 1
}