millis() is delaying 2 second beetween two while loop

unsigned long  timer;
boolean True_t1=true, True_t2=true;

void setup() 
{  Serial.begin(9600); }

void loop()
{      
  while(True_t1)
  { 
    if (Serial.available()>0)
   {
    timer=millis();
    
   True_t1=false;
   break;
   }
   } 
      
    while(True_t2)
    {
      Serial.println(timer);

     True_t2 =false;
     break;
    }    
}

I have been starting serial monitor and my mobile phone chronometer the same time bun when I send serial data and push button chronometer simultaneous,, monitoring serial delaying 2 seconds.. what is the problem?

I have been starting serial monitor and my mobile phone chronometer the same time

Opening the Serial monitor causes most Arduinos to reboot. Which Arduino board are you using ?

arduino UNO

I will send data via Bluetoorh , so I am just trying with aserial monitor.... Is there a problem when working with bluetoorh?

A 0.1 to 0.47µF capacitor between reset pin and GND will stop the UNO from resetting on serial connect, have to remove to program though.