batteryDiscargeTime(capacity, loadCurrent)

import electronics.battery.dischargetime-1

Calculate the battery discarge time.

import electronics.battery.dischargetime-1;
batteryDiscargeTime( 5 Ah, 2 A )
capacitythe capacity of the battery.
loadCurrentload current.
kPeukerts constant. It depends on battery type. If not given 1.3 is assumed.
dischargeRatethe discarge rate of the battery. If not given 20 hour rate is assumed (good for 99% of specifications).
return valuethe discharge time of the battery.

NOTE: The most of batteries have batteries have capacty specifications with 20 hour discharge rate (about 99% of them), so it is assumed to be the default. If Peukert's capacity is given, check out batteryDiscargeTime1H.

For more details, see https://en.wikipedia.org/wiki/Peukert's_law, http://www.smartgauge.co.uk/peukert2.html.