Serial packet speed

RBit:
Indeed, I didn't mention that I tried to increase the baud rate up to 256000.

I normally communicate between my Arduino program and Python programs on my Linux laptop at 500,000 baud and I don't recall ever missing any data.

It sounds like there is a problem on your PC program.

You have a very strange way of managing time in your Arduino program. Have a look at how millis() is used to manage timing in Several things at a time. Note that the tests for elapsed time always use subtraction as that avoids a problem when millis() rolls over.

...R