PIC18: Optimized load measurement