C program used to log the power consumption