1. A method of measuring capacitance, comprising: providing a first switch, wherein a terminal of the first switch is connected to a terminal of a first capacitor; providing a second switch, wherein a terminal of the second switch is connected to a terminal of a second capacitor; providing a third switch, wherein a terminal of the third switch is connected to another terminal of the first capacitor and another terminal of the second capacitor; and providing a P-type transistor, wherein a gate of the P-type transistor is connected to another terminal of the third switch; wherein when the first switch, the second switch and the third switch are turned on, a capacitance of the first capacitor, a capacitance of the second capacitor, or a ratio of a difference between the capacitance of first capacitor and the capacitance of the second capacitor to an average of the capacitance of first capacitor and the capacitance of the second capacitor is measured via the another terminal of the first switch, the another terminal of the second switch, and a source and a drain of the P-type transistor.