Use another function during the running of Millis

It still didnt work, can u help me?

#include<Servo.h>

Servo srv;

unsigned long startTime_servo = 0;
unsigned long internal_servo = 20;
int servo_angle = 0;

int i;

const int ledPin = LED_BUILTIN;// the number of the LED pin

// Variables will change:
int ledState = LOW; // ledState used to set the LED

void setup()

{

Serial.begin(9600);

pinMode(6, OUTPUT);

pinMode(5, INPUT);

srv.attach(7);

}

void loop()

{

unsigned currentTime= millis();

digitalWrite(6, LOW);

digitalWrite(6, HIGH);

int d=pulseIn(5,HIGH);

d=d/29/2;

Serial.println(d);

srv.write(0);

	if(d<=20 && d>1)

	{

		if(currentTime-startTime_servo>= internal_servo)
    	{
     		startTime_servo=currentTime;
      		srv.write(servo_angle);
      		servo_angle++;
      		if(servo_angle == 135)
        	{
           		servo_angle == 0;
        	}
    	}

	}

	else if(d<=50 && d>=21)

	{

		if(currentTime-startTime_servo>= internal_servo)
    	{
     		startTime_servo=currentTime;
      		srv.write(servo_angle);
      		servo_angle++;
      		if(servo_angle == 180)
        	{
           		servo_angle == 0;
        	}
    	}

	}

}