Problem regarding the use of the function millis()

//the code is used to know the time elapsed for a communication project.
//It doesn’t get compiled and uploaded.

int period = 1000;
unsigned long time_now = 0;
void setup() {
void loop() {
    time_now = millis();
    while(millis() < time_now += period){
        //wait approx. [period] ms

Your code doesn't make any sense. Please study this tutorial to learn how to do it correctly:

Your code doesn't make any sense.


First, using a while() loop to wait until millis gives the right time defeats the whole purpose.

Secondly, the += will increase time_now by period every pass through the while loop test.

There is a specific way to use millis() correctly - the guide per linked describes it.