wjwwood / serial

Cross-platform, Serial Port library written in C++
http://wjwwood.github.com/serial/
MIT License
2.16k stars 1.05k forks source link

The time interval between 2 frame is not stable. #304

Open JackZhouSz opened 3 weeks ago

JackZhouSz commented 3 weeks ago

Using libserial,

  1. I send one frame with write, wait for write to return, sleep for 1 ms
  2. then send the second frame, wait for write to return, and sleep again,
  3. repeating this process. However, the oscilloscope captures show that the time intervals sometimes measure 160 us.

Why is that? ideallythe write function is sync, the time intervals should be 1ms. Could you help me to find the cause