Running Function A halfway through Function B

Hello all, I am currently working on a project that requires some tasks to be performed halfway through a different task, without stopping either one. I'd like to have the code working as if function A were run halfway through function B without pausing function B.
My goal for this code is to have function makeBeep happen halfway through function turnServo, without pausing turnServo. Here's the code I've got.

#include <Servo.h>


int speakerPin = 3;
int beepTone = 493;
int beepLength = 50;
int ledPin = 6;
int pos = 0; //initial position of servo
int servoDelayTime = 5;
Servo turnHead; //declare servo

void turnServo() {
   for(pos = 0; pos < 180; pos += 1) 
  {
    turnHead.write(pos);
    delay(15);
  }
  for(pos = 180; pos>=1; pos-=1)
  {
    turnHead.write(pos);
    delay(15);
  }
}
  
  
  
  
void makeBeep() {
  tone(speakerPin, beepTone, beepLength); 
  digitalWrite(ledPin, HIGH);
  delay(50);
  digitalWrite(ledPin, LOW);
}

void setup() {
  pinMode(speakerPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  turnHead.attach(9);
  
}

void loop() {

turnServo();
  
}

Does anybody know of a good way to do this? I am very new to Arduino, so please do your best to make this easy to understand. Thank you for your time!

Sorry, but those for loops and delays will have to go.
Have a look at the blink without delay example in the IDE.

Oh I see. Thank you very much!

I've looked through that example, and it was fairly helpful. In the example there was only one time interval that I saw. Is there a way to do this in such a way that an LED would blink on for 50 ms and then turn off for 2000? Thanks!

Yes.
Look carefully at the variable "interval", with the emphasis on variable

You need to set up flags and timestamps to determine when the flashing will change state.