https://github.com/pantaluna/esp32_support_espidf3 Compare accuracy of vTaskDelay() and ets_delay_us(). Conclusion: never use vTaskDelay() for that purpose!