millis not counting ultrasonic pulses properly

I'm testing a MaxBotix MB7067 ultrasonic sensor and using the MaxBotix library and a test program from Github. Here's the program:

/*
  Maxbotix advanced test  took out Serial and Analog See original
  Instructions:
    Filters:
  * NONE (default): No filtering
  * MEDIAN: Take the median of a sample
  * HIGHEST_MODE: Take the mode of a sample. In case more than
  one mode, the highest one is returned
  * LOWEST_MODE: Take the mode of a sample. In case more than
  one mode, the lowest one is returned
  * BEST: Take the mode of a sample. In case more than one
  mode is found, the median is returned
  * SIMPLE: Continue reading until sample_size consecutive readings
  are issued
*/
#include "Maxbotix.h"

Maxbotix rangePW(8, Maxbotix::PW, Maxbotix::XL, Maxbotix::BEST);//use pulse input pin 8
//Maxbotix rangeSensorAD(A0, Maxbotix::AN, Maxbotix::LV, Maxbotix::BEST, 9);//Use analog pin A0
void setup()
{
  Serial.begin(9600);
  }

void loop()
{
  unsigned long start;
  Serial.println("Reading...");
  start = millis();
  Serial.print("   BEST: ");
  Serial.print(rangePW.getRange());//same as Mode...best of sample is largest value
  //rangePW.toInches;
  Serial.print("cm - ");
  Serial.print(millis() - start);
  Serial.println("ms - ");
  //printArray(rangePW.getSample(), rangePW.getSampleSize());//print all array values
  Serial.print(" - Highest Mode: ");
  Serial.println(rangePW.getSampleMode(true));//highest value of range
  Serial.print(" - Lowest Mode: ");
  Serial.println(rangePW.getSampleMode(false));//lowest value of range
  Serial.print(" - Median: ");
  Serial.println(rangePW.getSampleMedian());//middle value of range-NOT average
    delay(3000);//delay for testing only
  
  }
  //prints out all values in array.  Use for testing
  void printArray(float* array, uint8_t array_size) {
  Serial.print("[");
  for (int i = 0; i < array_size; i++) {
    Serial.print(array[i]);
    if (i != array_size - 1) {
      Serial.print(", ");
    }
  }
  Serial.print("]");
}

With a hard reflector 61 cm (2 feet) away, the program reports 58 cm (see attachment) which is close enough for the girls I go out with. But the value it reports for #of mS is not correct because this sensor has a scale output of 58uS/cm so that, at 61 cm, it should read 3.5 mS, NOT the 420mS it is reporting. I verified this with a scope showing exactly 3.44 mS pulsewidth. So why is the millis function reporting this erroneous value?

How long does the getRange() function take to execute ?

Ah...there's the rub. In the old days of Assembler and Basic, one would create a subroutine and know exactly what went into it in terms of commands. With Arduino libraries, a person can pick one command (ie a function) , thinking that's all that has to be executed. (I know, lame excuse, but when you are hurrying to get results, you forget what happens in background).

So that is the issue. In fact I did prove it to myself before I got this reply by replacing the call to the function as shown here:

// Serial.print(rangePW.getRange());
float cm=pulseIn(6,HIGH)/58.0;// 58 uS/cm
float duration=pulseIn(6,HIGH);

This gave me the correct answer. about 100 mS LESS (which would be the time taken to execute the function).

The reason I wanted to use the library was for the functions that perform the filtering of the incoming waves: Mean, Mode, and Median so I wouldn't have the complexity of coding those myself.

I'm using the sensor as a go/nogo device to detect vehicles, so TOF is not necessary.

You are using a very slow baud rate of 9600 so the Serial prints take most of the time. Try 115200