maxTime - 2 can cause type underflow because uint32_t is unsigned type