I think my issue is not fully understanding how the
millis() function works;
I am wondering the difference between simply creating a variable such as
long fake_millis ++ ;
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It only takes a minute to sign up.Sign up to join this community
millis() returns the ACTUAL time milliseconds since the start of the program. Wheter you put a delay, you do multiple tasks,
millis() will still return the right time.
The other method that you mentionned will not work if, for example, you add a delay in the program. Then, for more complex tasks that might take more time, your "custom" counter will be very unacurate.
I short, just use
millis(). It is easy to use and works great.
P.S. Use an
unsigned long instead of a