private-octopus / picoquic

Minimal implementation of the QUIC protocol
MIT License
523 stars 153 forks source link

Measure select delay #1701

Closed huitema closed 3 weeks ago

huitema commented 3 weeks ago

In theory, calling "select()" (or the equivalent on Windows) with a wait time of zero returns immediately. However, this is a system call. In high CPU usage condition, the OS may decide to take the opportunity and schedule a different process. In that case, the wait might be much longer. Measuring that time might allow us to detect such high CPU conditions.