How to estimate number of hours remaining before battery dies?

JimboZA:
I think half the trouble is how they estimate the upcoming use. The might have a good handle on Ah left (but I wouldn't know if they do or not) but they seem to take the instantaneous consumption and assume you'll be doing that non-stop until it dies. So if it looks like you have a long time left, as soon as you do something intensive for a few moments, your time left drops drastically based on that heavy load.

EXACTLY! That is also valid for cars. If my car tells my I have 50km worth of fuel left, I make that fuel last for at least 70km, because I will change the way I drive. Obviously the indicator will change as well, and increase the autonomy indication, which is a lot more than Windows does calculating remaining battery time.

Like it's been said, you can get at most a fair estimate, but not an actual precise prediction.

If you are trying to calculate remaining battery time on a device for which the power consumption doesn't change much over time and doesn't depend much on how humans use it, then you can get a very good estimate. In other words, if the consumption curve for the device is known and doesn't change much, calculating remaing battery time is pretty easy.