Why sleep(1)? Shouldn't it be sleep(0)?
Why should it he sleep(0).
With sleep(0) you only relinquish the current time slice. But maybe you want your program to wait a lot longer. Doing sleep(0) each time is waisting time for each cycle.
But it might have been better to use sleep(10) or sleep(50).
It would depend on your usecase for this new non-blocking sleep function.