Sleep Function
1. Introduction
Function Name: Sleep
Function: the execution is suspended for a period of time.
Usage: Unsigned sleep (unsigned seconds );
Use the header file in VC
# Include <windows. h>
In the GCC compiler, the header file used varies with the GCC version.
# Include <unistd. h>
2. Note
The first English character in sleep in VC is uppercase "S"
In standard C, sleep is used. Do not use uppercase letters. The following uses uppercase letters to describe how to use sleep. In short, sleep is used for VC and sleep is used for other purposes.
The general form of sleep functions:
Sleep (unisgned long );
The Unit in sleep () is millisecond, so if you want to keep the function for 1 second, it should be sleep (1000 );
In Linux, "S" in sleep is not capitalized.
Sleep () is measured in seconds rather than milliseconds.
3. Example:
# Include <windows. h>
Int main ()
{
Int;
A = 1000;
Sleep (a);/* VC uses sleep */
Return 0;
}