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.
/***********************************************************
* You can use all the programs on  www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact [email protected]
* To find more C programs, do visit www.c-program-example.com
* and browse!
* 
*                                  Happy Coding
***********************************************************/

#include <time.h>
#include <stdio.h>
#include <windows.h> 
#include <conio.h>

int main()
{
 printf("This is the message before sleep() function");
 Sleep(1000); //1000 microsecond= 1 second will sleep...
 printf("This is the message after 1 second");
 getch();
 return 0;
}

However, I have to remind you that the program may change a bit based on
what Operating system and compiler you are using.

Read more Similar C Programs
Learn C Programming
Number System

You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can Follow @c_program

You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!

Share this program with your Facebook friends now! by liking it

(you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!


List of C Programs
(c) www.c-program-example.com

Leave a Reply