+ 1
how to delay an output ?
which function or header file is used to delay the output for few seconds ?
4 Answers
+ 2
For Windows OS, this will work:
#include <windows.h>
Sleep(x);
Where x = # of milliseconds, where 1000ms = 1s
+ 1
dos.h and time.h
+ 1
this_thread::wait_for(chrono::seconds(1));
This is going to wait exactly one second. chrono is in library chrono and this_thread in library thread (i think).
0
@Ternary: Great example but unfortunately that's C++11 which is not being taught here. People here are using SoloLearns compiler and Borlands Turbo C++. Made my very first steps in C++, that's how old and obsolete Turbo C++ is now :-)