How to measure the power consumption of my application on Windows Mobile and Windows CE?

I want to measure energy consumption

  • my own application (which I can change)
  • Third party applications (which I cannot change)

on

  • Windows CE 5.0
  • Windows Mobile 5/6

Is there any kind of API for this?

If not, can I measure other values ​​that I can use to estimate energy consumption?

I do not need an exact value, for example 20 mAh (although that would be nice). A sufficient relative value, for example: "Starting from 100% to 0% charge, about 20% of the fully charged battery used by this application"

On the other hand, it is very important that the measurement is specific to one application, that is, I do not want aggregated measurements for a group of applications, for example, "these three applications together consume ..."

+1
source share
4 answers

There is an API for obtaining information about energy consumption, but the accuracy of the information returned by this API depends on the OEM (some OEMs do not provide information at all). More information with sample code in this API can be found at http://www.codeproject.com/kb/mobile/Wimopower1.aspx (screenshot of sample programs below). As you can see in the screenshot, you can indicate the battery voltage, current, type of battery, etc. Accurate estimates of instantaneous energy consumption require external equipment (and I assume that you do not want to invest in equipment for measuring).

Take any measurements that you get relative, because they cannot be representative of what you observe when you run your program on another device.

Screenshot Example program http://www.codeproject.com/kb/mobile/WiMoPower1/TitleImage.png

+3
source

This seems like a pretty difficult task to measure because you cannot isolate one process yourself. In fact, if you try to do this, you will have difficulty defining what constitutes the “only process” - is it just user space code belonging to this program? Or do you include kernel code executed on behalf of the program? What if the OS optimizes the kernel code so that similar requests from different programs are processed together using an almost constant amount of energy? Then you could not even highlight the use of energy by the program.

In that case, my tendency would be to measure the expected value, basically the average amount of energy used by the application. Ideally, you should start with a large number of systems, all the same, except that half of them have an application, and half of them are not. Let each system work under any operating conditions that you want to test (the same conditions for all devices, of course, except that half of them launch the application, and half do not) and either measure the speed of energy by consumption using the standard API, or for the batteries to discharge and measure how long it takes for each unit to discharge the battery. Then compare the average result with the devices that ran the application and the average result from those that were not, and you can find out how much the program increases the power consumption of the computer.

+3
source

If you really want to call api yourself, I don’t know which one to call, but if you just want to know how the power consumption is when launching certain applications, you can use the acbPowerMeter application.

acbPowerMeter displays the real-time power consumption data of your device. This utility is very lightweight, which allows you to benchmark your battery usage.

+1
source

Adding two cents, there are several libraries that can measure energy consumption using the INTEL RALP architecture :

There are PAPI and jRALP .

Using jRALP seems simple:

  double beginning = EnergyCheck.statCheck(); doWork(); double end = EnergyCheck.statCheck(); 

Unfortunately for the OP, they seem (I'm not sure) not ready for Windows, and they only work for certain Intel processors.

0
source

Source: https://habr.com/ru/post/1315566/


All Articles