On Measuring Energy Consumption