Designing for battery power

By the conservation of energy, known resistor, measure the voltage and time. Just hope your multimeter is reasonably accurate....

It's really quite an elegant solution if you read it