FreeRTOS PID Controller (stm32duino)
The standard FreeRTOS way of getting "time" is xTaskGetTickCount(). You can use configTICK_RATE_HZ to convert ticks to time.

You can also use one of the hardware timers you probably have for timestamping.