Arduino code only executing after 10 seconds

I have a project using an Arduino Mega 2560. Everything worked fine till yesterday. Now when the Arduino is powered on via USB, the code gets only executed after 10 seconds. After flashing the code gets executed immediately.

Any idea?

Not without the sketch !
Which BTW should be added using CODE TAGS ( </> )

#include <Adafruit_MAX31865.h>

Adafruit_MAX31865 max = Adafruit_MAX31865(8, 9, 10, 11);

#define RREF 430.0

int Out1=13;
int Out2=12;
int dimming1 = 100;
int dimming2 = 100;
int delay1 = 0;
int delay2 = 0;

int R = 5;
int G = 6;
int B = 7;

int Forward = 44;
int Backward = 45;
int Fan = 46;

int Button = 3;
int OpenT = 20;
int CloseT = 21;


String data[10];
String inString;
char Byte;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(Out1, OUTPUT);
  pinMode(Out2, OUTPUT);
  pinMode(R, OUTPUT);
  pinMode(G, OUTPUT);
  pinMode(B, OUTPUT);
  pinMode(Forward, OUTPUT);
  pinMode(Backward, OUTPUT);
  pinMode(Fan, OUTPUT);
  pinMode(Button, INPUT_PULLUP);
  pinMode(OpenT, INPUT_PULLUP);
  pinMode(CloseT, INPUT_PULLUP);
  
  attachInterrupt(digitalPinToInterrupt(2), zero_cross_int, RISING);
  attachInterrupt(digitalPinToInterrupt(Button), button_press, CHANGE);
  attachInterrupt(digitalPinToInterrupt(OpenT), openTrigger, CHANGE);
  attachInterrupt(digitalPinToInterrupt(CloseT), closeTrigger, CHANGE);

  noInterrupts();
  TCCR3A = 0;
  TCCR3B = 0;
  TCCR4A = 0;
  TCCR4B = 0;

  TCCR3B |= (1 << CS31);
  TCCR4B |= (1 << CS41);

  TIMSK3 |= (1 << TOIE3);
  TIMSK4 |= (1 << TOIE4);

  interrupts();

  max.begin(MAX31865_4WIRE);

  digitalWrite(G, HIGH);
}

void loop() {
  // put your main code here, to run repeatedly:
  if(Serial.available() > 0){
    inString = "";
    int index = 0;
    char buff[255];
    while(1){
      if(Serial.available() > 0){
        Byte = (char)Serial.read();

        if(Byte != 'q'){
          buff[index] = Byte;
          index++;
        } else {
          //buff[index] = ",";
          break;
        }
      }
    }
    char *p;
    
    p = strtok(buff, ",");
    
    index = 0;
    while(p != NULL) {
      data[index] = p;
      index++;
      p = strtok(NULL, ",");
    }
    if(data[0] == "set1"){
      dimming1 = (100 - data[1].toInt());
    } else if(data[0] == "set2"){
      dimming2 = (100 - data[1].toInt());
    } else if(data[0] == "getTemp"){
      Serial.print("Temperature,"); 
      Serial.print(max.temperature(100, RREF));
      Serial.print(",q");
    } else if(data[0] == "openDoor"){
      
    } else if(data[0] == "LEDR"){
        if(data[1].toInt() == 0){
          digitalWrite(R, LOW);
        } else {
          digitalWrite(R, HIGH);
        }
    } else if(data[0] == "LEDG"){
        if(data[1].toInt() == 0){
          digitalWrite(G, LOW);
        } else {
          digitalWrite(G, HIGH);
        }
    } else if(data[0] == "LEDB"){
        if(data[1].toInt() == 0){
          digitalWrite(B, LOW);
        } else {
          digitalWrite(B, HIGH);
        }
    } else if(data[0] == "MotorF"){
        digitalWrite(Backward, LOW);
        analogWrite(Forward, data[1].toInt());
    } else if(data[0] == "MotorB"){
        digitalWrite(Forward, LOW);
        analogWrite(Backward, data[1].toInt());
    } else if(data[0] == "MotorStop"){
        digitalWrite(Forward, LOW);
        digitalWrite(Backward, LOW);
    } else if(data[0] == "Fan") {
        analogWrite(Fan, data[1].toInt());
    }
  }
}

ISR(TIMER3_OVF_vect) {
  if(dimming1 == 100 || dimming1 <= 2){
    return;
  }
  digitalWrite(Out1, HIGH);
  delayMicroseconds(10);
  digitalWrite(Out1, LOW);
}

ISR(TIMER4_OVF_vect) {
  if(dimming2 == 100 || dimming2 <= 2){
    return;
  }
  digitalWrite(Out2, HIGH);
  delayMicroseconds(10);
  digitalWrite(Out2, LOW);
}

void zero_cross_int() {
  if(dimming1 == 100){
    digitalWrite(Out1, LOW);
  }
  if(dimming1 <= 2) {
    digitalWrite(Out1, HIGH);
  }
  if(dimming2 == 100){
    digitalWrite(Out2, LOW);
  }
  if(dimming2 <=2) {
    digitalWrite(Out2, HIGH);
  }
  delay1 = ((10000*dimming1)/100)+280;
  TCNT3 = (65536-((16 * delay1)/8));

  delay2 = ((10000*dimming2)/100)+280;
  TCNT4 = (65536-((16 * delay2)/8));

  //TCNT5 = 30000;
}

void button_press() {
  if(digitalRead(Button)){
    digitalWrite(R, HIGH);
    digitalWrite(G, LOW);
  } else {
    digitalWrite(R, LOW);
    digitalWrite(G, HIGH);
  }
}

void openTrigger() {
  digitalWrite(B, HIGH);
}

void closeTrigger() {
  digitalWrite(B, LOW);
}