Custom Millis() delay

I have a robot created that needs to switch from autonomous mode to motion control. The problem right now is that during autonomous mode there are too many delays and it misses the character. So i have attempted to create a custom timer. Right now its just a simple timer to turn an LED on after 2 seconds if the button is not pushed. Though it seems to turn it instantly when the button is not pushed. LED doesn't come on if the button. Any ideas?

unsigned long Timer;

void setup() 
{
  Serial.begin(9600);// put your setup code here, to run once:
  pinMode(13, OUTPUT);
  pinMode(7, INPUT);
  digitalWrite(7, HIGH);
}
  void loop() 
{
  int button = digitalRead(7);
  if(button == 1)
  {
    digitalWrite(13, HIGH);
    Timer = millis();
      if (( Timer - millis()) >= 15000)
     {
      digitalWrite(13, LOW);
     } 
  }// put your main code here, to run repeatedly: 
  
}

What will make the pin go low? External pulldown resistor?
Assuming you have one, the tiime test will never be true:

Timer = millis();
if (( Timer - millis()) >= 15000)

Timer- millis() will never be more than 1 most likely as the two instructions are mere microseconds apart.
Need to revise your logic.

Also, this can go before setup:
int button = digitalRead(7);
no need to declare it every pass thru loop; it can also just be a byte vs an int.

You have the Timer = millis() and the related IF in the wrong place.

The way you have it the value in Timer is updated just before the IF so it can never be different by 15000 msecs. (That's 15 seconds, not 2 seconds, by the way).

Look at how millis() is used in the sketch attached to the first post of this Thread. Then if you are still stuck I will try to help.

...R

Ok that all makes sense I was declaring the timer too much it was updating each cycle so it would never be correct.

I got it working with the code

unsigned long Timer;
int button = digitalRead(7);
boolean on = true;
void setup() 
{
  Serial.begin(9600);// put your setup code here, to run once:
  pinMode(13, OUTPUT);
  pinMode(7, INPUT);
  digitalWrite(7, HIGH);
  digitalWrite(13, HIGH);
  Timer = millis();

}
void loop() 
{

    if(button == 1)
    {
      customDelay();
    }// put your main code here, to run repeatedly: 
}

void customDelay()
{
  if (( millis() - Timer) >= 5000)
  {
    digitalWrite(13, LOW);
  }  
}

Now I need to reset the timer so when I push the button the delay starts again. Any ideas on how to do that, I tried

unsigned long Timer;
int button = digitalRead(7);
boolean on = true;
void setup() 
{
  Serial.begin(9600);// put your setup code here, to run once:
  pinMode(13, OUTPUT);
  pinMode(7, INPUT);
  digitalWrite(7, HIGH);
  digitalWrite(13, HIGH);
  Timer = millis();

}
void loop() 
{

  if(button == 1)
  {
    customDelay();
  }// put your main code here, to run repeatedly: 
  if(button == 0)
  {
    Timer= millis();
  }
}

void customDelay()
{
  if (( millis() - Timer) >= 5000)
  {
    digitalWrite(13, LOW);
  }  
}

Read the button again, and when you see it is pressed, turn on the LED, set Timer to millis() again to restart the 5 second pause.