How can I interrupt a delay() when a button is pressed? I have created a device that allows my son to track time spent on activities and exchanges that time into a time he can use with his electronics (eTime). 

Full code in GITHUB 

I am having trouble coding the part of the code that handles the countdown from his earned eTime. As it is right now it can count down and give him a warning when his eTime has run out, but the process can't be interrupted. 

I would like to have him be able to stop his eTime and use the remainder later. I tried putting the function in a while loop.

while(digitalRead(button_9)==LOW){
    delay(60000);
    avail_time -= 1;
    if(avail_time&lt;0){
      playAlarm();
      return;
}


This one registers the keypress but ignores the delay.

I have also tried using a for loop to count down and another to check every second for a keypress.

void useTime() {
  for(int i=avail_time+1; i&gt;0; i--){
    displayTime(i);
    for(int minute=60; minute&gt;0; minute--){
      if(digitalRead(button_9)==HIGH){
        avail_time = i;
        return;
      }
      delay(1000);
    }
  }
  while(digitalRead(button_9)==LOW){
    tone(buzzer, 2000);
    }
  noTone(buzzer);
  avail_time=0;
  displayOptions();
  return;
 }


That one does not register the keypress.
You can use the millis function to check the current 'time'. If you store this, and later call this function again, by subtracting you can see how much time has been passed. so instead of delay(500) you use if (millis() - timeStamp &gt;= 500) { ... to continue your code.

As others said in comments,  you also need to debounce to prevent multiple button triggers.

Edit: Debouncing

There is not a library for debouncing (at least not one on the Arduino site), but you can easily copy the needed code from the following sketch:

Arduino Debounce