doubt regarding Millis

holmes4:
@robin2 - I think the op wants to throw away all input before the 3 seconds, hence the flush.

That's as may be. But the reality is that Serial.flush() does not do that nowadays. And there is no new equivalent for what it used to do.

...R