I wonder if there's such API that I can use to measure the amount of battery energy comsumed in a function, such as:
begBattery = SomeAPI();
// do something
endBattery = SomeAPI();
batteryConsumed = endBattery - begBattery;
I found there's a API called GetBatteryInfo() of CTelephony, but the problem with this API is that its precision is too low, so I wonder if there's some better API.
Thanks in advance.