This thread has several examples for high-resolution frequency meters
I believe that you were looking for basic counter over fixed time window (which works well at high frequencies). Please see such example below.
I'm confused by the information provided in your link. Where does it explain how to start and stop the time in software and read the number of pulses received at the input please?
See updated post above for basic example
So is using the PWM more accurate than a delay?
I assume I set up same components and interrupt and implement code below at power up (I only need the measurement done once and then input is used for other function).
PWM_windowPeriod = 0.01;
uint32 counter_countVal = Counter_ReadCapture(); // Read the Counter capture register
uint32 input_freq = (uint32) ((double) counter_countVal * PWM_freq);
There are many ways to measure frequency. It is a balance between accuracy and dedicated system resources. I recommend to start with simple working example above and then modify it to your needs. Best counting accuracy which can be achieved this way is ~(1/2) x 125kHz x 10 ms = 625, e.g. 9-bit. Using software delay can only worsen it. Solution depends on what accuracy needed.
If result is needed only once on startup and h/w resources are limited, it all can be done in software by counting pulses directly using interrupt and utilizing SysTick timer to count delay window - no hardware needed. The 125kHz is low enough to use pin interrupt. Of course, the system will hang for some 10ms, but there is no penalty for that on startup.