Example of sleep function
The sleep function can be structured with a program.As you suggested above from the members and experts,It stops the execution of the program for a specified time interval.
Here,a code is shown which stops the execution of the program for 1 second -
Code:
#include <time.h>
#include <stdio.h>
#include <conio.h>
int main()
{
printf("This is Msg_1 \n");
sleep(1000); //1000 microsecond= 1 second will sleep...
printf("This is Msg_2 after 1 second.......");
getch();
return 0;
}
Bookmarks