while ( millis() - timer > interval ) { timer = timer + interval; }
This is an interesting discussion: