Switching a relay on and off using "millis()" without interfering with the runtime of the other piece of code

There's little commenting and I don't have time to figure out what, say, a variable anonymously named 'a' does but if it works for you that's all you really need.

There are a number of ways to get to a solution to most any problem. If this one works and you're happy with it use it.