evilC wrote:Am I missing something or is there no difference?
Your code exhibits the same problem.
I completely didn't remember your first post. But of course two loops will never run at the same time, AHK being single-threaded. I multi-thread when multiple, constant loops are needed. Timer works relatively well to allow a multi-loop-like environment, but if the loops are too large or take too much time, the other one won't be as timely as needed, usually. Being that, I can't agree that this method should be used quite like that.
evilC wrote:My point is that if you teach people one method - it should work in all instances.
I completely disagree. This is an unreasonable statement. For achieving accurate timing, a while-loop will be significantly better than having a bunch of timers running. Take an auto-clicker for example. You wouldn't want it to be interrupted by another timer that, say, couldn't perform a specific operation due to error and takes significantly longer to move past that, after the click sub has already been interrupted. Your clicker is then useless for an amount of time. While this isn't a high-chance thing, it still causes inconsistency. I've never actually had a need for what your talking about, and most shouldn't if they designed their scripts properly, but actual multi-threading would work in such a situation, quite well.
That is, using timers isn't a solution, it simply makes people think
it is, until they have subs taking too long. It works in some cases, and is tragic in others. Which, brings me back to "Different methods for different instances." There simply isn't one way to do anything, in any case. Code structure should be completely dependent on how it needs to operate, as to get the expected outcome.