I wrote a demo sketch that shows a more extensive use of the Blink Without Delay technique in this Thread. It may help to explain the concept.
In simple terms
you decide the duration you want for your activity
you record the value of millis() just before you start the activity
in every iteration of loop() you check whether the latest value of millis() - the start value exceeds your duration
if it does, you stop your activity.
...R