accurate sleep timers (10ms?)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Trigun
Posts: 41
Joined: 29 Mar 2017, 01:33

accurate sleep timers (10ms?)

20 May 2017, 16:24

hello
i was using this sleep function

Code: Select all

sleep(period := 1)
{
	static Frequency 		; frequency can't change while computer is on
		if !Frequency
			DllCall("QueryPerformanceFrequency", "Int64*", Frequency) 	
		DllCall("QueryPerformanceCounter", "Int64*", Start)
		Finish := Start + ( Frequency * (period/1000))
		loop
			DllCall("QueryPerformanceCounter", "Int64*", Current) 		;	eats the cpu
		until (Current >= Finish)
}
but after the last windows update i noticed all my macros are broken (they always miss the old timing)

for ex this

Code: Select all

ENTER::
gosub, sub1
sleep(280)
gosub, sub3
sleep(450)
gosub, sub1
sleep(450)
gosub, sub2
reload

before the update was working fine now i get the old result with this

Code: Select all

ENTER::
gosub, sub1
sleep(270)
gosub, sub3
sleep(440)
gosub, sub1
sleep(440)
gosub, sub2
reload

in a long macro the -10 don't works (sometimes i need to add delays)
how i can have a sleep that is always the same (on different computer too)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Araphen, ht55cd3, Joey5, mamo691, sebalotek and 369 guests