Delay between cout | SoloLearn: Learn to code for FREE!


Delay between cout

Hello I want to know how to put a Delay between cout .Thanks!

4/24/2017 8:54:50 AM

Alhasan Mohamed

1 Answer

New Answer


#include <iostream> #include <ctime> using namespace std; void delay(int milliseconds){ clock_t goal = milliseconds + clock(); while(goal>clock()); } int main(){ while(1){ cout << "Problem?" << endl; delay(1000); }; //That is self delay function }