Use nanosleep instead of poll.