Get Li-Ion battery capacity from discharge time (constant load)
You are trying to measure energy, of which the Joule is the basic unit.

The unit of Power is Watts, which is Joules/s

Voltage x Current = Instantaneous Power in Watts

If you sample the instantaneous power every second, you can simply add up the measurements.

Battery Capacity in Joules = (V0 * I0 * 1s) + (V1 * I1 * 1s) + ... + (Vx * Ix * 1s)

For very low loads (high resistances), you can bring this out to minutes since the battery voltage won't be changing very fast.  For heavy loads (3.9ohms), you probably want to measure at least once every 10s.

Good luck.

--- edited to add ---

You don't have to measure current if you have a known resistor since you know the voltage, you can calculate the current at those voltages.