Gate leakage current measurement of devices such as field-effect transistors (FET) and insulated-gate bipolar transistors (IGBT)