//sleep function provided by <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(){
printf("Sleeping for 5 seconds
");
sleep(5);
printf("Wake up
");
}
#ifdef __unix__
# include <unistd.h>
#elif defined _WIN32
# include <windows.h>
#define sleep(x) Sleep(1000 * (x))
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(){
printf("Sleeping for 5 seconds
");
sleep(5);
printf("Sleep is now over
");
}
#include <stdlib.h>
#include <stdio.h>
// this library provides sleep() function.
#include <unistd.h>
int main()
{
printf("sleeping");
sleep(5);
printf("
Woke up");
}
#include <unistd.h>
unsigned sleep(unsigned seconds);
sleep(5); //sleep for 5 secs
#include <Windows.h>
int main()
{
Sleep(500);
}
void sleep(unsigned int mseconds)
{
clock_t goal = mseconds + clock();
while (goal > clock())
;
}
void sleep(unsigned int mseconds)
{
clock_t goal = mseconds + clock();
while (goal > clock())
;
}
Code Example |
---|
C :: read from stdin c |
C :: c fopen |
C :: putchar in c |
C :: isspace |
C :: vowel and consonant C |
C :: number of hours, minutes, and seconds given the number of seconds. |
C :: C first digit of integer |
C :: how to reset all values of 2d vector to 0 |
C :: signal function c |
C :: form controls in bootsrap |
C :: how to use malloc in c |
C :: c check if character is a space |
C :: link list c |
C :: converting strings to numbers in c |
C :: how to take comma separated integer input in c |
C :: c language float user input |
C :: size of pointer in c |
C :: c strcmp |
C :: division en java |
C :: tuples in c |
C :: What should main() return in C? |
C :: logical operators in c |
C :: C Syntax of struct |
C :: C Accessing Union Members |
C :: metw.cc |
C :: C Operator associativity |
C :: gdebi install with yes option |
C :: binary operations on structs C |
C :: YOUNG SEX PARTY underground collection |
C :: Integer Output |