Simple question. In my code running on an Arduino Uno I attach interrupts in setup() to digital pins 2 and 3 to sense the output of a rotary encoder with some very simple interrupt service routines. In the main loop() I have some delay() calls that are several seconds long. This will be changed eventually, but I thought I'd leave it this way temporarily to see how interrupts and delays interact.
I wanted to see if anyone knows for sure whether the interrupts are sensed and serviced during the delay() calls? The reason I ask, is that it appears that they are serviced- I've had the value of the rotary encoder printed before and after the delays, and when I turn the encoder during the delay periods, I can see that the value of the encoder is incremented what appears to be the correct amount according to how much I've turned it.
Can someone confirm whether this is just luck, or if the interrupts are serviced as normal during delays? I've got very repeatable results doing some hand testing and I almost can't believe it. Thanks!