20#ifdef ESPHOME_THREAD_SINGLE
23 static uint16_t millis_major;
29 static constexpr uint32_t HALF_MAX_UINT32 = std::numeric_limits<uint32_t>::max() / 2;
33 uint16_t major = millis_major;
37 if (now < last && (last - now) > HALF_MAX_UINT32) {
41 }
else if (now > last) {
47 return now + (
static_cast<uint64_t
>(major) << 32);
50 static uint64_t compute(
uint32_t now);