Reading Mixed Serial If/Else ? ?

Robin2:
If it is just a safety timeout then that may be fine. The waitForString() function was not in the OP's snippet.

But I would not like a function that just twiddles its thumbs until the timeout expires. I would prefer to have the timeout separate so that other stuff can continue during the waiting period.

...R

Yes - I agree, it’s case specific. I think in the OP’s case it is justified