problem with Timer

hi guys i have a problem and need some help. i am working o na simple circuit two buttons one relay
button one triggers the relay for 5 seconds and than turns off. (remains triggered while button is held down)
button two re-triggers the relay during next 10 seconds only. (remains triggered while button is held down)

button two can not initially trigger the relay without button one being pressed first

i've tryed using millis function but problem is that relay doesn't remain triggered after elapsed time

i would appreciate your help

unsigned long start_time;
unsigned long current_time;
unsigned long elapsed_time;

void setup()

{

pinMode(4, OUTPUT);
pinMode(2, INPUT);
pinMode(3, INPUT);
digitalWrite(4, LOW);

}

void loop()
{

if (digitalRead(2) == HIGH){
digitalWrite(4, HIGH);
delay(5000);
digitalWrite(4, LOW);
start_time = millis();
current_time = millis();
elapsed_time = current_time - start_time; }

if ((elapsed_time < 10000) && (digitalRead(3) == HIGH))
{
digitalWrite(2, HIGH);

}

}

Try serial printing elapsed_time.

When do you update the value of elapsed_time? Or current_time? Only when the first button is pressed! So elapsed time is always 0 or 1

Instead of using an elapsed time variable, just do

if ((millis()-start_time > 10000) && (digitalRead(3) == HIGH))

Also, re: terminology this is a problem with millis(), not a problem with a "timer" - the latter implies a problem interacting with one of the hardware timers, which you're not doing here.