How to set a time out like Serial.setTimeout() for Serial.read()? I read a comment form here: 

"Serial.setTimeout() sets the maximum milliseconds to wait for serial data when using Serial.readBytesUntil(), Serial.readBytes(), Serial.parseInt() or Serial.parseFloat(). It defaults to 1000 milliseconds."

According to the latest webpage, 

"Serial functions that use the timeout value set via Serial.setTimeout():

Serial.find()

Serial.findUntil()

Serial.parseInt()

Serial.parseFloat()

Serial.readBytes()

Serial.readBytesUntil()

Serial.readString()

Serial.readStringUntil()


"

So apparently, there's no direct indication to set a timeout option for Serial.read().

How to set a time out like Serial.setTimeout() for Serial.read()?
You can't set timeout for read(), but you can use readBytes() to read one byte.

byte b;
int count = Serial.readBytes(&amp;b, 1); // read one byte with timeout
if (count) { // 0 or 1
  Serial.write(b); //echo
}