Question

I've wrote a small piece of code that reads the current battery charge/discharge on my laptop. I followed the example code on this MSDN page.

My program updates the information every 100ms (by calling the DeviceIoControl function with IOCTL_BATTERY_QUERY_STATUS as control code) but the read value changes only after 5-10 seconds. For example if I change the screen brightness from the minimum value to the maximum the rate is updated only 5-10 seconds later. I've used Visual C++ 2010 on Windows 7 32-bit.

Does anybody knows how to get a real-time reading of the charge/discharge rate?

Was it helpful?

Solution

Depending on the accuracy of the sensor, it is likely that the status is only updated by the power device driver every 5-10 seconds or when significant changes take place.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top