Advice regarding AC current measurement using a microcontroller
Getting the correct RMS value from mains can be very challenging project. First you do need a quite high sampling rate, then use a lowpass FIR filter, but preferably a bandpass so it eliminates also the DC drift. Then you square, integrate, calculate square root. Preferably you do integrate only full periods, so zero cross detection is also needed.
If you want to do it simple, then the best option is to use an ASIC with integrated DSP and ADC that does all this, else you might exhaust all the MCU resources and still the result is questionable. You can find those ASICs for energy metering application, ADI, MAXIM, ...
Note: You are asking about current measuring and you are comparing measured power discrepancy. Power is v*i, so an accurate current measurement is not warranty for an accurate power measurement in absence of accurate voltage measurement and phase.