Run code once timer reaches X seconds.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Elentinus
Posts: 2
Joined: 15 Dec 2021, 21:27

Run code once timer reaches X seconds.

15 Dec 2021, 21:30

Found nothing on Google.
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: Run code once timer reaches X seconds.

15 Dec 2021, 21:34

Please post some code you've tried and be very specific about what you're trying to do.
User avatar
flyingDman
Posts: 2832
Joined: 29 Sep 2013, 19:01

Re: Run code once timer reaches X seconds.

15 Dec 2021, 21:35

Search on "autohotkey timer". First result.
14.3 & 1.3.7
Elentinus
Posts: 2
Joined: 15 Dec 2021, 21:27

Re: Run code once timer reaches X seconds.

15 Dec 2021, 21:46

Basically, I wanna have some code be executed every 200ms. The issue is that block of code doesn't take the same amount of time to execute every time, so I wanna start a timer before the code is executed, execute the code, then once timer reaches 200ms, execute again.
User avatar
mikeyww
Posts: 27191
Joined: 09 Sep 2014, 18:38

Re: Run code once timer reaches X seconds.

16 Dec 2021, 06:34

That is how a timer works.

Code: Select all

#Persistent
start := A_TickCount
SetTimer, Go, 1000
Return
Go:
list .= A_TickCount - start "`n"
ToolTip, %list%
Sleep, 200
Return
The documentation as already noted above contains additional details and suggestions.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: arrondark, DRS and 107 guests