Estimate how long a battery will last from its capacity and the current your device draws, with a realistic efficiency derating.
Ideal runtime is capacity ÷ current draw. Real batteries deliver less than their rated capacity under load, so a derating factor (often 70 to 85%) gives a more realistic estimate. Heavy loads, cold temperatures and old cells reduce it further.
The ideal runtime is the battery capacity divided by the current draw, so a 2000mAh battery powering a 150mA device lasts about 13.3 hours. Real cells deliver less under load, so a derating factor gives a more honest figure.
Rated capacity is measured under gentle, ideal conditions. Under a real load you lose some to internal resistance, voltage cutoff and heat, so 70 to 85% of the rating is a common, more realistic assumption. Lower it for high-drain or cold use.
Yes, just keep units consistent: if you enter capacity in mAh, enter the current in mA. For an amp-hour rating, multiply by 1000 to get mAh first.