We are using six buttons in our app, with values coming from a Node MCU through Firebase. Currently, we are experiencing delays in value updates when input is given through the app. How can we solve this issue?

void loop() {
  if (millis() - sendDataPrevMillis > 2000 && Firebase.ready() && signupOK) {
    sendDataPrevMillis = millis();

    String paths[] = {
      "Sensor/rightRot",
      "Sensor/leftRot",
      "Sensor/leftLat",
      "Sensor/rightLat",
      "Sensor/extensionStatus",
      "Sensor/flexionStatus"
    };
    String commands[] = {"b", "a", "c", "d", "e", "f"};
    String updatePaths[] = {
      "Sensor/rightRotation",
      "Sensor/leftRotation",
      "Sensor/leftExtension",
      "Sensor/rightExtension",
      "Sensor/extension",
      "Sensor/flexion"
    };
    double values[] = {
      random(0, 100), // random_rightRotation
      random(0, 100), // random_leftRotation
      random(0, 100), // random_leftExtension
      random(0, 100), // random_rightExtension
      random(0, 100), // random_extension
      random(0, 100)  // random_flexion
    };

    for (int i = 0; i < 6; i++) {
      if (Firebase.RTDB.getString(&fbdo, paths[i])) {
        if (fbdo.dataType() == "string") {
          String statusStr = fbdo.stringData();
          if (statusStr.equalsIgnoreCase(commands[i])) {
            if (Firebase.RTDB.setDouble(&fbdo, updatePaths[i], values[i])) {
              Serial.println("Data updated successfully for " + updatePaths[i]);
            } else {
              Serial.println("Failed to update data for " + updatePaths[i] + ": " + fbdo.errorReason());
            }
          }
        }
      } else {
        Serial.println("Failed to get data for " + paths[i] + ": " + fbdo.errorReason());
      }
    }
  }
}

@Amirtha Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Copy and paste these if you can’t find the correct symbol on your keyboard.

I would also suggest that you shorten your topic title to something more sensible, and move the majority of your existing title into the body of your post, then expand on that information to make the Firebase side of the process understandable.

Pete.