Methods for measuring battery capacity