title: Measure ESP32 CPU Utilization
body: <p>I am communicating two ESP32 boards which are connected to a Wifi Network. One ESP32 board is the Server and the other is the client. I want to measure the ESP32 CPU utlization on the client ESP32. I have no idea how to do it and have not yet found any useful resources on the internet. Can someone help me with this?</p>
  
  <p>This is the code on server </p>
  
  <pre><code>#include &lt;WiFi.h&gt;
  #include &lt;ESPAsyncWebServer.h&gt;
  const char* ssid = "XXXXX";
  const char* password = "XXXX";
  AsyncWebServer server(80);
  void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid,password);
  while (WiFi.status()!= WL_CONNECTED){
  delay(200);
  Serial.println("Connecting to Wifi...");
  }
  Serial.println("Connected to Wifi");
  Serial.println(WiFi.localIP());
  server.on("/test", HTTP_GET, [](AsyncWebServerRequest *request){
  Serial.println("Request received from esp32client");
  request-&gt;send(200, "text/plain", "Hello from ESP32Server to ESP32Client");
  });
  server.on("/test1", HTTP_GET, [](AsyncWebServerRequest *request){
  Serial.println("Request received from PC-Client");
  request-&gt;send(300, "text/plain", "Hello from ESP32Server to PC");
  });
  
  server.begin();
  
  }
  
  void loop() {
  // put your main code here, to run repeatedly:
  
  }
  </code></pre>
  
  <p>This is the code on Client</p>
  
  <pre><code>#include &lt;WiFi.h&gt;
  #include &lt;HTTPClient.h&gt;
  const char* ssid = "XXXXX";
  const char* password ="XXXXX";
  void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid,password);
  while (WiFi.status()!= WL_CONNECTED){
  delay(500);
  Serial.println("Connecting to Wifi...");
  }
  Serial.println("Connected to Wifi Network...");
  Serial.println(WiFi.localIP());
  
  }
  
  void loop() {
  
  HTTPClient http;
  
  http.begin("http://192.168.43.35/test");
  int httpCode = http.GET();
  
  if (httpCode &gt; 0) {
  
  String payload = http.getString();
  Serial.println(httpCode);
  Serial.println(payload);
  }
  
  else {
  Serial.println("Error on HTTP request");
  }
  
  http.end(); 
  
  delay(30000);
  
  }
  </code></pre>