No. The sleep(2)
will only affect the single user. However, if you want to do rate limiting, this is still not a great way to go about it.
A malicious user could theoretically open up 1,000 simultaneous requests to example.php
and in 2 seconds, have it executed 1,000 times. If requests are overlapped, this could theoretically be executed as many times per second as the attacker wants (up to the capacity of the server of course).
As an alternative, you may want to look at something like the generic cell rate algorithm. The general idea with rate limiting is to throw away requests which go over the limit as efficiently as possible.