Measure Time within a Task with xTaskGetTickCount()

gibsonpw wrote on Saturday, September 01, 2018:

Hi,

I am trying to measure the execution time of a function a FreeRTOS task with xTaskGetTickCount(). The code looks like the following example.

static void prvRxTask( void *pvParameters )
{

	for( ;; )
	{
		long start = xTaskGetTickCount();
        func_doing_something();
        long stop = xTaskGetTickCount() - start;
        
		vTaskDelay( pdMS_TO_TICKS( 1000UL ) );

	}
}

My result of stop is always “0” because the xTaskGetTickCount() gets not incremented durring the tasks execution. Why is that so? (I activated the timer in the FreeRTOSConfig.h) If it is relevant, I am using a Zedboard with a Zynq 7000 SoC.

rtel wrote on Sunday, September 02, 2018:

Duplicate of https://sourceforge.net/p/freertos/discussion/382005/thread/6d2307a0/