understanding attachinterrupt in a pulse counter

The ISR will be called at any time the trigger condition is met whether that is inside the if or not as long as interrupts are enabled