Nobody will steal that spelling error!
It’s too obvious to see it’s been cut from somewhere else that can’t spell !
lmao If only they had the same logic as you
It is possible to read the Serial input without any delay.
For an Arduino Uno also the String object should be avoided.
The functions parseInt(), readBytesUntil() and so on make use of a internal timeout (they really wait some time). Those should be avoided.
A call to delay() to wait for the whole line to be received is silly of course, that is what I did in my example.
My solution is this: millis_serial_timeout.ino.
It accepts a input with Carriage Return and/or LineFeed at the end or without those. Without those, a timeout is needed. I use millis() for the timeout so there is no delay and no waiting in the code.
I use millis() as a timestamp to remember the time a byte was received. Then a timeout is easy.
Once you understand millis(), it is fun.
There is no standard Arduino function that does that We all have to write our own code when we want a good solution.