+ 1

C++ sleeping

Could someone explain to me how to use sleep(), Sleep(), usleep() etc and what library (ies) to include? I can't find good answers anywhere

1st Jan 2018, 2:56 PM
RandoM_ 11
RandoM_ 11 - avatar
2 Answers
+ 7
In C++, we don't use sleep() instead we use delay(), but it will not work in sololearn... If you have other compiler like dosbox turbo compiler, then try this.... #include <iostream> #include <dos.h> //for the delay int main{ delay(1000); //equals to 1 second or 1000 milliseconds return 0; }
1st Jan 2018, 3:48 PM
Jayson Ondiano
Jayson Ondiano - avatar
+ 2
sorry
1st Jan 2018, 2:57 PM
Kunal Kumar
Kunal Kumar - avatar