How can I measure the energy consumption of my application on Windows Mobile and Windows CE?

前端 未结 4 841
傲寒
傲寒 2020-12-20 07:59

I want to measure the energy consumption of

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

on

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-20 08:22

    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.

提交回复
热议问题