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
🌐
GitHub
github.com › peufeu2 › ESP32FastMillis
GitHub - peufeu2/ESP32FastMillis: Faster millis() and micros() for ESP32 and AceRoutine · GitHub
The fix is simple: ESP32 has timers with hardware predividers, so this small piece of code just sets up TIMG0_T0 to run on 1 MHz, dividing APB clock by 80. Then, micros() is just two instructions to read the 32-bit micros value from the timer.
Author   peufeu2
🌐
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.
Discussions

micros() & delayMicroseconds() not good enough
There was an error while loading. Please reload this page · Calling micros() twice is in a row, takes nearly 50uS More on github.com
🌐 github.com
13
March 23, 2017
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
ESP32 micros() bug
On ESP32, micros() takes about 150 cycles. More on github.com
🌐 github.com
14
March 12, 2022
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
🌐
SparkFun Electronics
sparkfun.com › sparkfun pro micro - esp32-c3
SparkFun Pro Micro - ESP32-C3 - SparkFun Electronics
SparkFun Pro Micro - ESP32-C3
This SparkFun Pro Micro crams the powerful ESP32-C3, a single-core RISC-V powerhouse with 400KB of SRAM, into a compact 1.3in. x 0.7in. board.
Price   $10.25
🌐
GitHub
github.com › espressif › arduino-esp32 › issues › 282
micros() & delayMicroseconds() not good enough · Issue #282 · espressif/arduino-esp32
March 23, 2017 - Calling micros() twice is in a row, takes nearly 50uS. Something line: uint32_t t0 = micros(); uint32_t t1 = micros(); uint32_t delta_t = t1 - t0; printf( "Delta = %u\n", delta_t ); // this prints around 51 on my system. Looking at the i...
Author   espressif
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
🌐
ESP32 Forum
esp32.com › viewtopic.php
how to SET esp_timer_get_time() ? - ESP32 Forum
unsigned long IRAM_ATTR micros() { return (unsigned long) (esp_timer_get_time()); } How can i solve this, without hacking the library? Is there a way to add an offset by app to esp_timer_get_time()? - Perhaps by using a wake stub, which adds a sleep time offset immediately after wake up? - Or is there a way to overwite the micros() function of arduino-esp32 with a customized version?
🌐
Wikipedia
en.wikipedia.org › wiki › ESP32
ESP32 - Wikipedia
4 days ago - These chips feature a variety of processing options, including the Tensilica Xtensa LX6 microprocessor available in both dual-core and single-core variants, the Xtensa LX7 dual-core processor, or a RISC-V microprocessor. In addition, the ESP32 incorporates components essential for wireless ...
Find elsewhere
🌐
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.
🌐
YouTube
youtube.com › hollanda academy
Mastering Time Control on ESP32: millis and micros Explained | Arduino IDE Tutorial - YouTube
Description:🚀 Unlock the power of time control in your ESP32 projects! In this comprehensive tutorial, I walk you through the usage of Time Delay, millis(),...
Published   October 10, 2021
Views   887
🌐
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.
🌐
GitHub
github.com › pstolarz › OneWireNg › issues › 38
ESP32 micros() bug · Issue #38 · pstolarz/OneWireNg
March 12, 2022 - On ESP32, micros() takes about 150 cycles. I'm using 80MHz CPU clock to avoid wasting power, delayMicroseconds() calls micros() at least twice. This means delayMicroseconds() takes at least 330 cycles, corresponding to a delay of more th...
Author   pstolarz
🌐
ESP32 Forum
esp32.com › viewtopic.php
Wait microsecond - ESP32 Forum
Hi All, Please let me know if anyone has achieved this type of micro seconds delay support in application firmware. I need 10 and 40 microseconds delay support as per request. ... The arduino-esp32 core achieves this using the following code for the delayMicroseconds() func.
🌐
Hackster
hackster.io › news › sparkfun-s-pro-micro-range-gets-a-little-riscier-with-the-new-pro-micro-esp32-c3-risc-v-dev-board-054dd5983dd1
SparkFun's Pro Micro Range Gets a Little RISCier with the New Pro Micro ESP32-C3 RISC-V Dev Board - Hackster.io
March 20, 2026 - As you'd expect from an ESP32, there's wireless connectivity: single-band IEEE 802.11b/g/n Wi-Fi plus Bluetooth 5 Low Energy (BLE) with Bluetooth Mesh support, the radios for both of which share a single on-board antenna. The module's various features are then brought out to castellated pin headers in the Pro Micro format, with 22 user-accessible general-purpose input/output (GPIO) pins and SPI, UART, I2C, I2S buses, a TWAI controller compatible with CAN 2.0, and pulse-width modulation (PWM) plus analog to digital converter (ADC) pins.
🌐
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 › 1357
Troubles using micros()/millis() form esp-idf · Issue #1357 · espressif/arduino-esp32
April 26, 2018 - Board: ESP32 DEVKITV1 Core Installation/update date: 25/apr/2018 IDE name: Arduino IDE/IDF component Flash Frequency: 80Mhz Upload Speed: 115200 · micros() returns strange values when using arduino-esp32 as component of esp-idf, millis() returns ...
Author   espressif
🌐
Reddit
reddit.com › r/arduino › sub microsecond delays on esp32
r/arduino on Reddit: Sub microsecond delays on esp32
December 18, 2021 -

Do I have to write instructions in assembly? Im using Arduino IDE and im trying to sample a signal at 44.1khz. I come from a PIC Micro background where I would just use a TMR. Whats the play here in Arduino Land?

🌐
Amazon
amazon.com › ESP-WROOM-32-Development-Microcontroller-Integrated-Compatible › dp › B08D5ZD528
Amazon.com: ESP-WROOM-32 ESP32 ESP-32S Development Board 2.4GHz Dual-Mode WiFi + Bluetooth Dual Cores Microcontroller Processor Integrated with Antenna RF AMP Filter AP STA Compatible with Arduino IDE (3PCS) : Electronics
ELEGOO 3PCS ESP-32 Development Board USB-C, 2.4GHz Dual Mode WiFi+Bluetooth 4.2 Dual Core Microcontroller Support AP/STA/AP+STA, CP2102 Chip | low-power IoT applications, smart devices, automation, wireless communication, GPIO headers, simplifying development · hiBCTR 6 Packs ESP32-DevKitC-32 ...
🌐
Arduino
docs.arduino.cc › language-reference › en › functions › time › micros
micros() | Arduino Documentation
June 5, 2025 - This function returns the number of microseconds since the Arduino board began running the current program.
🌐
SparkFun Electronics
sparkfun.com › sparkfun thing plus - esp32 wroom (micro-b)
SparkFun Thing Plus - ESP32 WROOM (Micro-B) - SparkFun Electronics
SparkFun Thing Plus - ESP32 WROOM (Micro-B)
This Feather-compatible ESP32 board features dual-core processing, WiFi, Bluetooth, a micro-B USB port, and a plug-and-play Qwiic connector.
Price   $24.95