i need to set a timer to timeout if no data is received from the serial com port.

I cant use sleep() as data may come in anytime and need to be processed immediately. sleep() will halt the program...