Also as BobK pointed in right direction, have the followings into consideration.

If you use RTC to calculate the elapsed time, you will have difficulties when time passes from one minute to other, or from one hour to other. You will be lost in HEX conversions to come with elapsed time.

I highly recommend using Melanie’s Olympic timer. It is already a timer just as you need, it is not an RTC.

It is quite easy to implement it into your PIC; even if you can’t use it with your PIC, have your energy calculation in your PIC by getting a signal from a separate PIC in which the Olympic timer is implemented.