Since sleep basically shuts down your script unconditionally for a definite period of time the A_TickCount loop like SetTimer lets you do other stuff until it times out
No it does not. A loop is nothing like SetTimer. AHK_L is a single-threaded language. If one thread is active (Sleeping or being in a loop that does nothing DOES NOT relinquish control to another pseudo-thread) then another cannot be. SetTimer however fires the timer code, and once that code returns, resumes processing of other stuff.
This also extends to hotkeys - they will interrupt the current thread and not relinquish until they complete.
Code: Select all
CoordMode, ToolTip, Screen
while (true)
{
ToolTip, MAIN Loop %A_TickCount%, 0, 0, 1
Sleep 10
}
return
F12::
ToolTip, HOTKEY CODE %A_TickCount%, 500, 0, 2
Sleep 1000
return