Measure capacitance using RC time constant.
Start with open switch then close to begin measurement.
Open the switch until the capacitor is fully discharged
T = RC
where T is the time for the capacitor to charge to 63.2% given the R resistor and C capator.