So I made this reusable timer macro that works fine in itself. The problem arose when I came up with the idea to add a while loop to the timer so I can basically run a tick only when the timer is active… seems like it would be extremely useful.
Here is the timer macro:
I think this should work but whenever I activate the timer, the while loop complains about an “infinite loop”. This makes no sense to me because when the timer is not active or when it is cleared, the elapsed time is -1, and since I have the “>=” condition, it should not be an infinite while loop??? Help!