Runtime frequency measurement

Is there any (simple) way to have the runtime frequency measurement of a signal, pulse-by-pulse? I need something in the schematic diagram which is able to detect the frequency of an input signal, outputting the value of the frequency for every single signal cycle. This is needed to track the frequency of a switching power supply, and to plot it into the waveform viewer, together with other signals. This is a very useful function for power supply investigation, and for instance it is available in my oscilloscope.
Any hint?

@kskelvin made his version of PWM analyzer.

I got too many posts and even cannot remember where is mine. :rofl:

I suggest the DLL version, that is most reliable and not be affected by .option, as cshunt can break that analog logic. DLL version is in that same post.