Trying to get one arduino to sense another's direction with ultrasonic sensors

The idea behind this is that one ultrasonic sensor on the guide will send out pulses to two receivers on the follower, and the difference in time between when the two receivers get the pulse will determine the direction of the guide. the receivers and the guide are on two different arduinos because they need to be different objects. However, when I try and print the time in millis() that each receiver gets the signal on the serial monitor, the numbers seem to be random and even negative. How do I fix this?

when I try and print the time in millis() that each receiver gets the signal on the serial monitor, the numbers seem to be random and even negativ

You certainly don't get negative numbers from millis(), but as a wild guess, you have used an int to hold the value from millis() and the value overflows the variable

How do I fix this?

Start by reading this : Read this before posting a programming question
then follow the advice about posting code in code tags and giving full details of your project

Got it.

My code is as follows:

void loop()
{
  if(pulseIn(receiver1, HIGH));
  {
    time1 = millis();
    Serial.print("time1: ");
    Serial.println(time1);
  }
  if(pulseIn(receiver2, HIGH));
  {
    time2 = millis();
    Serial.print("time2: ");
    Serial.println(time2);
  }
   Serial.println(time1-time2);
  delay(10);
}

Thanks for your help!

edit: thanks a lot for your help, it did end up being an overflow issue. I'll keep in mind how to post better.

My code is as follows:

Sometimes I just want to give up

Did you read the advice in the link that I posted ?
If you did then you certainly did not follow it.

increasing exponentially from there with each loop.

What else did you expect millis() to do ?