There is a fundamental flaw in almost every use of delay() AND millis() !
Many devs use them to WAIT while an external event is completed…
e.g. Send a command to a modem, wait/delay 100ms then continue.
Either way, it slows the performance of the code, and in the worst case simply fails to perform the task. It could use millis, and remain responsive but only pushes through 30% of its potential.
Libraries and most hobby code rarely test for completion of anything, but simply take a leap of faith that ‘after a while’ the device or cooperative code is ready to continue.
The downside is that to do it properly takes significantly more code and thinking. A trade off that is often short-circuited for a 95% success rate. We can reboot for those other 5% of failure events!
I have a tweaked GSM modem ’driver’ that runs asynchronously as fast as the modem and network responses allow… the throughput boost of send - test - send - test,,, is significant when compared to send - wait - send - wait…