I want to validate the time taken to send the “message” to message queue and receive the message from message queue. could you suggest any method how to validate that time?
The easiest way to measure time is calling
If your FreeRTOS clock runs at 1000 H0z, it will give you a precision of 1 or 2 millisecond.
Sending / receiving messages through a message queue, will take a fraction of a millisecond, so you will need a more precise clock. Normally I’d use a Timer-Counter, which can be configured to run at any speed. A 32-bit timer can give you microseconds, and a timer interrupt at every second to count the seconds as well.
Mind you that the speed depends heavily on a a few settings: stack checking makes things slower. And also the compiler optimisation level has a big influence.
If you are running FreeRTOS on an ARM Cortex M3/4/7, then you could use the ARM cycle counter: https://mcuoneclipse.com/2017/01/30/cycle-counting-on-arm-cortex-m-with-dwt/