How do I remove all delays from my code?

non-blocking timing becomes much easier to understand if the principle is explained with

1. an everyday example

2. carefully named variable-names

So here is another approach to explain how non-blocking timing based on function millis() works

and here is a demcode showing how state-machines are working

best regards Stefan