Interrupt and delay problems on Attiny 85 I wrote this code and uploaded it to attiny85:

 int hours = 2;
 int minutes = 4;
 static int MINUTES_COUNT_BIT = 5;
 static int HOURS_COUNT_BIT = 3;
 #define button 2
void setup() {
  pinMode(3,OUTPUT);
  pinMode(4,OUTPUT);
  pinMode(button,INPUT);

  attachInterrupt(0,pin_ISR,CHANGE);



}

void loop() {

  // put your main code here, to run repeatedly:


}

void pin_ISR(){
    if(digitalRead(button)==LOW){
      for(int i = HOURS_COUNT_BIT;i&gt;=0;i--){
      byte act_bit = bitRead(hours,i);

      switch(act_bit){
        case 0:
          digitalWrite(3,HIGH);
          delay(1000);
          digitalWrite(3,LOW);
          delay(1000);
          break;
        case 1:
          digitalWrite(4,HIGH);
          delay(1000);
          digitalWrite(4,LOW);
          delay(1000);

          break;
        }

    }
  }

  }


When I click button it lights up LEDs but it is so much faster than 500 milliseconds it looks like that:
https://drive.google.com/open?id=0ByeWvrEgy2gRNUp3MDNxQTAxd2c
Please help
In short:


Arduino delay() is relying on millis().
The millis() function is  updated by timer ISR.
ISR handler blocks all other ISRs by disabling global interrupts.
No update for millis results into deadlock in delay if you use it in another ISR


And recommendation for ISRs? Do it as short as possible! Set some volatile flag and do the action later outside of ISR.