Int value servo control and program flow

I understand and thank you for your input. It is duly noted and I will try the sketch with those corrections.

Regarding the 120hz: Since the measurement is calculated anyway it seems like the that could be compensated for easily.

The points being made here are very good ones. I am just using examples I found. However the 120hz factor was mitigated by the original creator I believe because when starting this project I used a breadboard and arduino to validate the AC power monitoring function. It worked well. Timing issues didnt arise until I started to lengthen the sketch code with servo commands