doubt regarding Millis

I think your code will do what you want. But you don't need Serial.flush(). It is badly named and it is only relevant (and then not much) when the Arduino is sending data.

...R