Hi @pb632146.
The test delays used in examples are primarily for demonstration purposes and but are not recommended for final implementations as they are blocking, and their theoretical delay value are only rough estimates.
As mentioned in the community post, to add the Osif System Timer Clock Reference, you need to include the Mcu module in the MCAL. Alternatively, instead of adding a System Timer Clock Reference, you can directly use the Timer Clock Frequency, which is by default of 48MHz on the S32K344 device. Additionally, I suggest to refer to the S32K3xx Reference Manual available at S32K3 Microcontrollers for Automotive General Purpose to check the default system clock frequency and the available clock sources for each S32K3 device.
Regarding the delay you mentioned, a delay with a value of 4,800,000 with the 48MHz internal clock would theoretically result in a delay > 0.1 seconds. However, this value will be always bigger since instructions take more than one clock cycle to execute. For better accuracy, I suggest to use the Osif functions available by including Osif.h library to your project once configured as seen on the community post you shared, where you can find a blocking delay function with a better precision.
If you are interested in measuring your program’s runtime more accurately, you can configure a timer with a known value, increment a counter on each interrupt, and use this to estimate the runtime. Alternatively, you can toggle a GPIO pin at the start and end of the section you wish to measure and then observe the duration of the signal with an oscilloscope.
Please let me know if you have more doubts.
- RomanVR.
Best Regards!