Delay in reading millis by serial monitor

ESP_DEVKIT
Posts: 1
Joined: Wed Aug 07, 2024 9:06 pm

Delay in reading millis by serial monitor

Postby ESP_DEVKIT » Wed Aug 07, 2024 9:28 pm

I'm using "DOIT ESP32 DEVKIT V1".When applied the below code, there are about ten milliseconds between readings. It is unknown what the controller is doing during this time.
#Code:

void setup() {
Serial.begin(115200);

}

void loop() {

Serial.println(millis());

}

#Sambel of result in Serial monitor:

56469
56469
56469
56469
56469
56469
56469
56469
56469
56469
56469
56469
56479
56479
56480
56480
56480
56480
56480
56480
Attachments
missing millis.png
missing millis.png (31.15 KiB) Viewed 472 times

ESP_Sprite
Posts: 9575
Joined: Thu Nov 26, 2015 4:08 am

Re: Delay in reading millis by serial monitor

Postby ESP_Sprite » Thu Aug 08, 2024 1:07 am

It's sending the millis to your serial monitor. That takes time as well. It doesn't for the first bunch of readings as there is a buffer that slowly fills up.

Who is online

Users browsing this forum: Bing [Bot] and 143 guests