How to calculate serial delay time between NodeMCU and Arduino

Hello,

I’m trying to calculate the serial delay (I’m using the SoftwareSerial library) between nodemcu and arduino
SoftwareSerial baud rate 9600

this is my code, where serialSoft is a SoftwareSerial object

in Arduino (part of the code - send data)

StaticJsonBuffer<1000> jsonBuffer;
JsonObject& root = jsonBuffer.createObject();
root["zoneNumb"] = zoneNumb;
root["A"] = numbers[0];
root["B"] = numbers[1];
root["C"] = numbers[2];
root["D"] = numbers[3];

t1 = micros();
root.printTo(serialSoft); //send json structured data to nodemcu
t2 = micros();

secInMicros = t2 - t1;
Serial.print("Serial (time taken in micros): ");
Serial.println(secInMicros);

in NodeMCU (part of the code - receive data)

StaticJsonBuffer<1000> jsonBuffer;
t1 = micros();
JsonObject& root = jsonBuffer.parseObject(serialSoft); // receive json structured data from arduino
t2 = micros();
  
if (root == JsonObject::invalid())
   return;

secInMicros = t2 - t1;
Serial.print("Serial (time taken in micros): ");
Serial.println(secInMicros);

The time I get in micros is
Arduino time: -17180
NodeMCU time: 768411

My question is how can I calculate the whole time it took to transfer the data and what was the delay, also I did not understand why Arduino gave me a negative number.

Any help would be appreciated!

With 9600 Baud you can send 960 characters (10 bit) per second.

Use unsigned long for all times for meaningful output. You missed these declarations for your variables, but the symptoms are characteristic.