Skip to content
Home » Sleep in c programming

Sleep in c programming

Let’s start the discussion about Sleep in c programming in the following Approaches.

The sleep feature provides a simple way to have the application wait for a brief period of time. The sleep function waits for seconds or until a signal is sent, whichever comes first. If sleep returns because the requested interval has expired, it returns zero.

sleep in c programming

//sleep function provided by 
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
 
int main(){
  
	printf("Sleeping for 5 seconds \n");
	sleep(5);
	printf("Wake up \n");  
}

I hope the strategies listed above work for you. Happy coding and come back again.

Similar Post : How to remove last character from a string in C