views:

748

answers:

3

I want to measure the energy consumption of

  • my own application (which I can modify)
  • 3rd party applications (which I can't modify)

on

  • Windows CE 5.0
  • Windows Mobile 5/6

Is there some kind of API for this?

If not, can I measure other values which I can use to estimate the energy consumption?

I don't need an exact value like 20 mAh (although that would be nice) A relative value would suffice, like: "Starting from 100% to 0% charge status, around 20% of the fully charged battery was used by this application"

On the other hand it is very important that the measurement is specific to a single application, i.e. I don't want aggregated measurements for a group of applications, like, "those three applications together consume ..."

+1  A: 

If you really want to call the api's yourself I wouldn't know which one to call, but if you just want to know how the power consumption is while running certain applications you could use the acbPowerMeter application.

acbPowerMeter charts the real-time power usage of your device. This utility is very light-weight, allowing benchmarking of your battery usage.

Davy Landman
+2  A: 

That seems like a rather difficult thing to measure, because you can't really isolate a single process to run by itself. In fact, if you tried to do so you'd run into difficulty defining what constitutes a "single process" - is it just the userspace code that belongs to that program? Or do you include the kernel code executed on behalf of the program as well? What if the OS optimizes kernel code so that similar requests from different programs are handled together, using a nearly constant amount of energy? Then you couldn't even separate out the energy usage by program.

In a case like this, my inclination would be to measure the expectation value, essentially the average amount of energy used by the application. Ideally you'd start with a large number of systems, all identical except that half of them have the application running and half of them don't. Let each of the systems run under whatever operating conditions you want to test under (same conditions for all devices, of course, except for the fact that half of them are running the app and half are not), and either measure the rate of energy consumption using the standard API, or let the batteries run out and measure how long it takes each unit to drain its battery. Then compare the average result from the devices that were running the app vs. the average result from those that weren't, and you can figure out how much the program increases the power consumption of the computer.

David Zaslavsky
+2  A: 
Joel