7#include <core_esp8266_features.h>
11#include <user_interface.h>
37static constexpr uint32_t MILLIS_RARE_PATH_THRESHOLD_US = 10000;
38static constexpr uint32_t US_PER_MS = 1000;
51 state.last_us = now_us;
52 state.remainder += delta;
53 if (
state.remainder >= MILLIS_RARE_PATH_THRESHOLD_US) {
60 state.remainder -= ms * US_PER_MS;
65 while (
state.remainder >= US_PER_MS) {
67 state.remainder -= US_PER_MS;
80 optimistic_yield(1000);
87 while ((elapsed =
micros() - start) < total_us)
88 esp_delay(((total_us - elapsed) >> 10) + 1);
uint32_t IRAM_ATTR __wrap_millis()
uint32_t IRAM_ATTR HOT micros()
void HOT delay(uint32_t ms)
uint32_t IRAM_ATTR HOT millis()