If your Arduino board has a lot to do and is waiting in a while-loop for 99% of the time, that would not be efficient.
It is better to use millis-timers to do things, instead of hanging around in while-loops.
To get out of while-loops or do-while-loops, a variable or a break is used.
bool running = true;
while(running)
{
if(...)
running = false;
}
while(true)
{
if(...)
break;
}
A millis-timer in a while-loop does not make sense. In that case, a delay() would be better. Can you show a small sketch that shows the problem ?
Millis-timers are versatile. The interval can be changed while it is running; It can be turned on and off in other parts of the code; It can blink with a pattern; and so on.
I made a few basic examples: Fun with millis