[C / C ] Sleep function in C / C – Function Sleep in C/C

Ham sleep(int n) used to generate 1 period “Sleeping” program (n seconds). To use it we declare library unistd.h.

#include <unistd.h>
#include <iostream>

int main()
{
    std::cout << "Sleeping for 10 seconds ..." << std::endl;
    sleep(10);
    return 0;
}