Hi again I finally wrote a quick and dirty code to test micros() versus HighPrecTimer. It performs 10000 calls to micros() and same thing to HPrecTimer. Here is the result :slight_smile: micros() has a 50ns overhead compared to High Precision Timer call. It is only a delay not a jitter or a lack… Answer from freedom2000 on community.simplefoc.com
🌐
Mechatronics LAB
mechatronicslab.net › home › lessons › esp32 arduino programming handbook › chapter 12: timers, delays & interrupts › using micros() for esp32 arduino programming
Using micros() for ESP32 Arduino Programming - Mechatronics LAB
What Is micros() and Why Use It? The micros() function tells you how many microseconds have passed since the ESP32 started running. It’s like having an ultra-fast stopwatch in your program.
Discussions

Measuring pulse duration more accurately with ESP32
Hi everyone, I would like to measure a pulse duration of 32us (4 clock cycles at 125kHz). Therefor I set an interrupt on the according pin. The interrupt is triggered with the rising and falling edge and store the start & endtime with the funktion micros() in two diffrent variables. More on forum.arduino.cc
🌐 forum.arduino.cc
8
0
May 31, 2022
strange micros() behavior
Hardware: Board: Adafruit Huzzah32 Feather Core Installation/update date: 19-Feb-2018 IDE name: Arduino 1.8.5 Flash Frequency: 80Mhz Upload Speed: 921600 Description: I am trying to use a run-of-th... More on github.com
🌐 github.com
10
March 3, 2018
Troubles using micros()/millis() form esp-idf
Hardware: Board: ESP32 DEVKITV1 Core Installation/update date: 25/apr/2018 IDE name: Arduino IDE/IDF component Flash Frequency: 80Mhz Upload Speed: 115200 Description: micros() returns strange valu... More on github.com
🌐 github.com
3
April 26, 2018
How to connect Arduino Pro Micro and ESP32 ?
Depends what your goal is, but easiest way is a UART connection. RX to TX, TX to RX. Then you can just use the serial library to send things back and forth. Keep in mind the Micro is 5v and the ESP32 is 3.3v logic, so you will need a logic level converter between the two. You will also need a shared ground connection. More on reddit.com
🌐 r/arduino
11
1
June 16, 2024
🌐
SimpleFOC Community
community.simplefoc.com › t › possible-bug-with-esp32-micros-function › 122
Possible "bug" with ESP32 micros() function - SimpleFOC Community
September 16, 2020 - Hi all, Being aware of the following bug with micros() function in ESP32 arduino, I have jumped into the FOCutils.cpp file and seen that the bug is probably called ☹ The bug is explained here: https://github.com/espressif/arduino-esp32/issues/1168 Trust me micros() is not reliable with ESP32.
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Measuring pulse duration more accurately with ESP32 - Programming - Arduino Forum
May 31, 2022 - Hi everyone, I would like to measure a pulse duration of 32us (4 clock cycles at 125kHz). Therefor I set an interrupt on the according pin. The interrupt is triggered with the rising and falling edge and store the start & endtime with the funktion micros() in two diffrent variables.
🌐
DeepBlue
deepbluembedded.com › home › blog › arduino micros() function – (millis vs micros)
Arduino Micros() Function - (millis vs micros)
August 17, 2023 - The Arduino micros() is a function that returns to you the time elapsed (in microseconds) since the Arduino board was powered up. Which can be used to create a time base for various events in your applications (like LED blinking, short pulse ...
🌐
GitHub
github.com › espressif › arduino-esp32 › issues › 1168
strange micros() behavior · Issue #1168 · espressif/arduino-esp32
March 3, 2018 - I am trying to use a run-of-the-mill Arduino e-paper display library that happens to watch a certain "busy" pin, and reports debug info via Serial.printf() when the pin appears busy for too long. The code is a delay(1) spin loop, and it is almost instantly reporting timeout. This caused me to write some of my own debug code to test the behavior of the micros() implementation in the HAL.
Author   espressif
🌐
GitHub
github.com › espressif › arduino-esp32 › issues › 1357
Troubles using micros()/millis() form esp-idf · Issue #1357 · espressif/arduino-esp32
April 26, 2018 - Hardware: Board: ESP32 DEVKITV1 Core Installation/update date: 25/apr/2018 IDE name: Arduino IDE/IDF component Flash Frequency: 80Mhz Upload Speed: 115200 Description: micros() returns strange values when using arduino-esp32 as component...
Author   espressif
Find elsewhere
🌐
ESP32 Forum
esp32.com › viewtopic.php
how to SET esp_timer_get_time() ? - ESP32 Forum
I am using a time critial library (MCCI LMIC), that depends on micros() as monotonic time base. In arduino-esp32 micros() is hardwired to esp_timer_get_time(), which does not persist it's counter value during deep sleep. Thus micros() cannot act as a monotonic counter after waking up from sleep.
🌐
Random Nerd Tutorials
randomnerdtutorials.com › home › arduino › arduino ide › getting started with the esp32 development board
Getting Started with the ESP32 Development Board | Random Nerd Tutorials
August 5, 2024 - Dual-core: most ESP32 are dual-core— they come with 2 Xtensa 32-bit LX6 microprocessors: core 0 and core 1. Rich peripheral input/output interface—the ESP32 supports a wide variety of input (read data from the outside world) and output (to ...
🌐
Wikipedia
en.wikipedia.org › wiki › ESP32
ESP32 - Wikipedia
4 days ago - Arduino-ESP32Arduino core for the ESP32, ESP32-S2, ESP32-S3 and ESP32-C3. ... Mongoose OS – an operating system for connected products on microcontrollers; programmable with JavaScript or C.
🌐
Visual Micro
visualmicro.com › page › How-to-install-Esp32-for-Arduino-and-Visual-Micro.aspx
How to install Esp32 for Arduino and Visual Micro
October 2, 2025 - The Esp32 web site provides a more advanced install but DFRobot provide a simple esp32 installation for Arduino using the standard Arduino board manager. Add the following url to the board support packages in the visual micro IDE location window or follow the guide
🌐
GitHub
github.com › espressif › arduino-esp32 › blob › master › cores › esp32 › esp32-hal-misc.c
arduino-esp32/cores/esp32/esp32-hal-misc.c at master · espressif/arduino-esp32
unsigned long ARDUINO_ISR_ATTR micros() { return (unsigned long)(esp_timer_get_time()); } · unsigned long ARDUINO_ISR_ATTR millis() { return (unsigned long)(esp_timer_get_time() / 1000ULL); } · void delay(uint32_t ms) { vTaskDelay(ms / portTICK_PERIOD_MS); } ·
Author   espressif
🌐
NORVI Controllers
norvi.io › home › esp32 vs arduino: which microcontroller should you choose?
ESP32 vs Arduino: Key Differences, Speed & IoT Uses
March 19, 2026 - The ESP32, developed by Espressif Systems, is a high-performance, low-power microcontroller designed for IoT, wireless communication, and advanced embedded systems. Unlike the Arduino Uno, it has built-in Wi-Fi and Bluetooth, allowing direct ...
🌐
Reddit
reddit.com › r/arduino › how to connect arduino pro micro and esp32 ?
r/arduino on Reddit: How to connect Arduino Pro Micro and ESP32 ?
June 16, 2024 - Bring us your Arduino questions or help answer something you might know! 😉 ... Depends what your goal is, but easiest way is a UART connection. RX to TX, TX to RX. Then you can just use the serial library to send things back and forth. Keep in mind the Micro is 5v and the ESP32 is 3.3v logic, so you will need a logic level converter between the two.
🌐
Hackster.io
hackster.io › 514301 › micro-ros-on-esp32-using-arduino-ide-1360ca
Micro ros on ESP32 using arduino IDE - Hackster.io
January 31, 2024 - In this tutorial you will learn how to connect ESP32 with micro-ROS and ROS 2. You will also learn how to install micro-ROS agent in Linux.
🌐
Arduino
store-usa.arduino.cc › collections › arduino® nano esp32
Arduino Nano ESP32® – Powerful Board for IoT Projects
Arduino® Nano ESP32
The new member to our iconic Nano family, the Nano ESP32. This board brings all the power of the well-known ESP32-S3 with the full support of the Arduino ecosystem, allowing makers to explore the world of Arduino and MicroPython without any blocker. Introducing the Nano ESP32, a powerful addition to the Arduino ecosystem that brings the popular ESP32-S3 to the world of Arduino and MicroPython programming. Whether you're a beginner stepping into the world of IoT or MicroPython, or an advanced user looking to incorporate it into your next product, the Nano ESP32 is the perfect choice. It covers
Rating: 4.9 ​
🌐
Arduino
docs.arduino.cc › language-reference › funções › time › micros
micros()
The official Arduino programming language structure reference pages.
🌐
GitHub
github.com › espressif › arduino-esp32 › issues › 5282
Issue with millis and micros with interrupt. · Issue #5282 · espressif/arduino-esp32
June 11, 2021 - //Change the code below by your sketch #define pin 19 volatile unsigned long time_prv = 0; volatile unsigned long time_cur = 0; int time_diff = 0; volatile int counter = 0; void IRAM_ATTR ttt() { time_prv = time_cur; time_cur = micros(); counter++; } void setup() { // put your setup code here, to run once: Serial.begin(115200); pinMode(pin, INPUT); Serial.println("Wait for 2 Sec Delay"); delay(5000); Serial.println("Over and Start"); counter = 0; attachInterrupt(digitalPinToInterrupt(pin), ttt, FALLING); } void loop() { // put your main code here, to run repeatedly: time_diff = time_cur - time_prv; if(time_diff != 0) { Serial.println((60000000 / time_diff)); } }
Author   espressif
🌐
Instructables
instructables.com › circuits › arduino
How to Get an Arduino Micros() Function With 0.5us Precision : 5 Steps - Instructables
October 17, 2017 - How to Get an Arduino Micros() Function With 0.5us Precision: I love Arduino microcontroller programming, and I regularly use it in aerospace research, as well as in home projects. As I work on my many home projects, however, I frequently find myself needing a very precise timer.