sleep
is sometimes used in a mistaken attempt to prevent Denial of Service (DoS) attacks by throttling response rate. But because it
ties up a thread, each request takes longer to serve that it otherwise would, making the application more vulnerable to DoS attacks, rather
than less.
Noncompliant code example
if (is_bad_ip($requester)) {
sleep(5); // Noncompliant
}