I am just a super beginner and I wanted to make simple stopwatch script with "DllCall", not with "tickcount".
But as I searched with my poor English, I couldn't find any. So here it is, the super simple stopwatch, for super beginners like me.
F3 for start, F4 for stop and send the time between them as text.
Code: Select all
;Precise? Timer
F3::
CounterBefore = ;var
DllCall("QueryPerformanceCounter", "Int64*", CounterBefore)
return
F4::
CounterAfter = ; var
DllCall("QueryPerformanceCounter", "Int64*", CounterAfter)
Send, {(}
Counterresult := (CounterAfter - CounterBefore)/2525000
Send, % Round(Counterresult, 1) ; rounds up the number
Send, {)}{Right}
return
Code: Select all
F6::
CountBefore =
DllCall("QueryPerformanceCounter", "Int64*", CounterBefore)
Sleep, 1000
CounterAfter =
DllCall("QueryPerformanceCounter", "Int64*", CounterAfter)
Msgbox, % (CounterAfter - CounterBefore)
return
Also, I need detailed info here, if you have one.
But anyhow, this will do something, and can get a bit more constant result than the "tickcount" function, so yeah....