How can be computed the switching frequency?

try this one I have try to build a F-V converter, otherwise the best is a state machine block

freq_meas.plecs (12.6 KB)