pulse sensor and ISR stops the rest of my code

DrDiettrich:
If you don't know how to use a global flag, modify your sketch like this:

bool flag = false;

void loop(){
  if (flag) {
    flag = false;
    T2SR();
  }
}
ISR(TIMER2_COMPA_vect){
  flag = true; }
void T2SR() {

can you clear more why using flag ?