//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())
;
}