//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
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 :: bootstrap 5 image responsive |
C :: how to empty string in c |
C :: how to print the first character of a string in c |
C :: c argv |
C :: %d in c |
C :: c random array |
C :: right side of div |
C :: c read csv |
C :: how to scan in c |
C :: typedef in c |
C :: c program to print the multiplication table |
C :: int_min in c |
C :: c float |
C :: C scanf() to read a string |
C :: malloc c include |
C :: struct main function c in unix |
C :: write a c program to find size of variable |
C :: typedef vs #define |
C :: pointers to a function in c |
C :: lichess puzzles |
C :: how to take comma separated integer input in c |
C :: apt-mark remove hold |
C :: chevront de vlavier |
C :: print only last 3 number float in c |
C :: Relational Operator in C language |
C :: fifo in c |
C :: les fichiers en c |
C :: c code recursive function to print numbers between two numbers |
C :: allocating memory for 1Mb text file in C |
C :: Minimum Distance between words[AMAZON] |