How to avoid Loop() blocking if wifi connection is lost?

@peekay123, I think @BDub is right because I have 2 AC lines and don’t see how that could be solves using one interrupt. I think I did not mention that I am not only interested sensing if there is power but also what the phase shift between the phases is.