The sleep () function forces the program or process that it is called to briefly halt its execution for the amount of time provided in seconds by the function parameter. Until the specified time has passed or the function receives a signal or an interrupt, execution is halted.