S
Scott Gifford
Hello,
I'd like to try out a few different implementations of part of my
application to see which is most power efficient. I need to send data
across the network, and I'd like to experiment with UDP vs. TCP, cost
of setting up and tearing down the Internet connection every time,
etc.
To measure power consumption, I'm getting battery status information
by P/Invoking GetSystemPowerStatusEx2. I'm following this
example:
http://msdn2.microsoft.com/en-us/library/aa457088.aspx
and using this documentation for the fields:
http://msdn2.microsoft.com/en-us/library/ms941842.aspx
Everything seems to be working correctly, except that many of the
fields are always zero. In fact, for the primary battery (not the
backup) I only get BatteryVoltage, BatteryLifePercent, BatteryFlag,
and BatteryChemistry. And BatteryLifePercent seems to go down in 5%
intervals, which doesn't give much precision.
My questions are:
* Is there a better way to measure power consumption of an
application, or to get power status information from within .NET?
* Is it surprising that so many of these values would be zero? I'm
disappointed I can't get BatterymAHourConsumed, as it seemed like
it would measure exactly what I wanted.
* Is the delta in battery voltage a reasonable way to measure power
consumption, and is it linear? For example, if in one run
BatteryVoltage drops from 4000 to 3900, and in another it drops
from 3900 to 3800, is it reasonable to assume that they both
consumed about the same amount of power? Is there some place I
can find documentation on this?
Thanks for any thoughts!
---Scott.
I'd like to try out a few different implementations of part of my
application to see which is most power efficient. I need to send data
across the network, and I'd like to experiment with UDP vs. TCP, cost
of setting up and tearing down the Internet connection every time,
etc.
To measure power consumption, I'm getting battery status information
by P/Invoking GetSystemPowerStatusEx2. I'm following this
example:
http://msdn2.microsoft.com/en-us/library/aa457088.aspx
and using this documentation for the fields:
http://msdn2.microsoft.com/en-us/library/ms941842.aspx
Everything seems to be working correctly, except that many of the
fields are always zero. In fact, for the primary battery (not the
backup) I only get BatteryVoltage, BatteryLifePercent, BatteryFlag,
and BatteryChemistry. And BatteryLifePercent seems to go down in 5%
intervals, which doesn't give much precision.
My questions are:
* Is there a better way to measure power consumption of an
application, or to get power status information from within .NET?
* Is it surprising that so many of these values would be zero? I'm
disappointed I can't get BatterymAHourConsumed, as it seemed like
it would measure exactly what I wanted.
* Is the delta in battery voltage a reasonable way to measure power
consumption, and is it linear? For example, if in one run
BatteryVoltage drops from 4000 to 3900, and in another it drops
from 3900 to 3800, is it reasonable to assume that they both
consumed about the same amount of power? Is there some place I
can find documentation on this?
Thanks for any thoughts!
---Scott.