if the 400msec is from sending a command to getting a result, that would include:
- the output time; I would expect this simply is around N msec for N characters; it could be more on a USB-to-serial cable, as again data would be packetized probably based on a timeout;
- the reaction time; I don't know what your peripheral is, it needs to collect the command characters, interpret them, come up with an answer and send it; a tiny microcontroller (or poor software) might spend quite some time here; and if it is a meter of some kind, maybe it first has to perform its measurement, then report.
- only now can the PC start processing input. As I said earlier, that too would get packetized by the cable.
if the main thread sends and waits, maybe it would be better to have it send and receive, without DataReceived event.
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.