I have created a c++ app that needs to connect to a modem via a serial port in order to give AT commands. I've followed the following answer: how to open, read, and write from serial port in C and it works great. In some point of the code it is mentioned that the working thread should sleep for enough time so that the sending and the reading of the characters to be consistent.
usleep ((7 + 25) * 100);
Since I'm not familiar enough with the linux system calls like usleep, I want to ask if this call is safe for the other linux processes that running in parallel with my program, or should I use the c++ default thread suspend execution method like std::this_thread::sleep_for?
In case I use usleep are there things that I should watch for?