Search This Blog

Loading...

C Program to show Sleep() function example.

C Program to show Sleep() function example. sleep() function stops the execution of the program, wherever its invoked or called. It takes the arguments in microseconds. In Windows we use Sleep() function i,e 'S', and for other systems it is sleep() function.Sleep function delays program execution for a given number of seconds.

#include <time.h>
#include <stdio.h>
#include<windows.h>
#include <conio.h>
int main()
{
printf("This is the message before sleep() function\n");
Sleep(1000); //1000 microsecond= 1 second will sleep...
printf("This is the message after 1 second");
getch();
return 0;
}

No comments:

Post a Comment