Fully electronic method of measuring post-release gap and gradient/residual stress of a MEMS cantilever