       }
     }
 
-    if (DEBUG_PRINT) {
-      wifiMills = millis() - startMills;
+    wifiMills = millis() - startMills;
+    if (DEBUG_PRINT) {
       Serial.println();
       Serial.print("===> WiFi connected : ");
       Serial.println(wifiMills);

  }

  system_deep_sleep_set_option(2);
  //wifi_set_phy_mode(PHY_MODE_11N);

  digitalWrite(redLED, LOW);
  wifi_connect();

  }

  if ( subMsgReceived == HIGH ) {
    subMills = (millis() - startMills) - wifiMills ;
    if (DEBUG_PRINT) {
      Serial.print("sub received ---> ");
      Serial.println(subMills);
