Timer without delay 2

Hi all. I'm very inexperienced with Arduino. I've made a small submersible. It has a magnetic switch that turns on a motor for a set length of time. To do this I've used a very simple if statement with a delay to time it.

sketch here
#include <Servo.h>

Servo esc;
Servo servo;
void setup()
{
esc.attach(3);
servo.attach(2);

Serial.begin(9600);
// Since the other end of the reed switch is connected to ground, we need
// to pull-up the reed switch pin internally.
pinMode(Reed, INPUT_PULLUP);
esc.writeMicroseconds(1000); // send "stop" signal to ESC. Also necessary to arm the ESC.
delay(5000);
servo.write(90);
}

void loop()
{
esc.writeMicroseconds(1000); // send "stop" signal to ESC. Also necessary to arm the ESC.
int proximity = digitalRead(Reed); // Read the state of the switch
if (proximity == HIGH) // If the pin reads low, the switch is closed.
{

esc.writeMicroseconds(1000); // send "stop" signal to ESC.;       

delay(15);
}
else
{
delay(1000);
esc.writeMicroseconds(2000); // send "stop" signal to ESC. Also necessary to arm the ESC.; // sets the servo position according to the scaled value
delay(60000);
}

}

I've since added a servo connected to a rudder that uses an HMC5883L magnetometer sensor to keep the sub in a straight line.

So my question is, how do I time the esc to turn off after a set amount of time while allowing the programme to routinely check the magnetometer and adjusting the servo accordingly

Take a look at the blink without delay example in the IDE, without delay.

Please remember to use code tags when posting code

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination