Ping sensor has trouble with alternative delays

Hello,

I have a parallax ping sensor and I'm trying to post the distance on my serial monitor without spamming it.

This is my code:

int signal = 6;
int afstand;
int Count = 0;
unsigned long pulse=0;

void setup() {
  Serial.begin(9600);
  //Ping Sensor
  pinMode(signal, OUTPUT);
}

void loop() {
  ParallaxPing();
  Count++;

  if (Count == 100) {
    Count = 0;
    Serial.print("Afstand - ");
    Serial.println(afstand);
  }
}

void ParallaxPing() {
  pinMode(signal, OUTPUT);

  digitalWrite(signal, LOW);
  delayMicroseconds(5);

  digitalWrite(signal, HIGH);
  delayMicroseconds(5);
  digitalWrite(signal, LOW);

  pinMode(signal, INPUT);

  pulse = pulseIn(signal, HIGH);

  pulse = pulse / 2;
  afstand = int(pulse / 29);
}

Using this count method, the readings get extremely unaccurate and it posts quicker when the distance gets shorter (when I put something about 10cm in front of the sensor).

Trying this code, the ping sensor updates slowly, it depends on the const long interval (can see it from the status led on the ping sensor):

int signal = 6;
int afstand;
int Count = 0;
unsigned long pulse=0;

unsigned long previousMillis = 0;
const long interval = 500;

void setup() {
  Serial.begin(9600);
  //Ping Sensor
  pinMode(signal, OUTPUT);
}

void loop() {
  ParallaxPing();
  Delayprint();
}

void ParallaxPing() {
  pinMode(signal, OUTPUT);

  digitalWrite(signal, LOW);
  delayMicroseconds(5);

  digitalWrite(signal, HIGH);
  delayMicroseconds(5);
  digitalWrite(signal, LOW);

  pinMode(signal, INPUT);

  pulse = pulseIn(signal, HIGH);

  pulse = pulse / 2;
  afstand = int(pulse / 29);
}

void Delayprint() {
  unsigned long currentMillis = millis();

  if (currentMillis - previousMillis >= interval) {
    previousMillis = currentMillis;

    Serial.print("Afstand - ");
    Serial.println(afstand);
  }
}

How can I fix this issue?

If you ping too frequently, you run the risk of starting to listen before all the distant echoes from the previous ping have died away, which may get received, and mistaken for nearby objects.
I'd start by limiting the ping rate to no more than 20 Hz (50 ms between pings)

I changed them to 50, it is now more accurate and I checked it with servos and leds and the delay doesn't affect the reaction time, the led on the sensor blinks at the delay (500ms). (I use the 2nd method I wrote).
Thanks!