Normally, main() is provided by the Arduino core, and the user provides setup() and loop(), which are called by the core's main() AFTER various things like the millis() timer have been set up and initialized.
By including main() in your sketch, you have over-ridden the core function, the timers have never been initialized, and millis() won't work. It's the sort of mistake we usually see from "experienced C programmers", since main() is The Way in normal C and C++ programs. You're probably looking at a generic C programming book that is "not quite" applicable to the Arduino. ![]()