Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Sometimes, we want to suspend execution of a process for a fixed amount of time. While it is possible to do this using a combination of sigsuspend() and the timer functions already described, it is easier to use one of the sleep functions instead.
The sleep() function suspends execution of the calling process for the number of seconds specified in the seconds argument or until a signal is caught (thus interrupting the call).