ESP-IDF equivalent of Arduino ESP.restart()

The Arduino function ESP.restart() is used to restart the ESP32. In ESP-IDF, you can achieve the same functionality using the esp_restart() function.

#include <esp_system.h>

void myFunc() {
  // ...
  esp_restart();
}