How can I sleep or pause the program excecution by a few seconds in C? I'm looking for something like this that is used in Java:


Is possible do this using C ? Thanks in advance.

2 Answers

Omkar Guhilot On Best Solutions

There is an answer here: What is the proper #include for the function 'sleep' in C?

Be careful that it works differently in Unix and Windows, whereas in one is measured in millisecs and in the other in secs.

Daniel Muñoz Parsapoormoghadam On
#include <stdio.h>
#include <unistd.h>

int main (void){


    return 0;

Read more here.