There is no such function and you got "unresolved symbol" errors.
Or there is a function, but you saw
- all your strings quickly => you just got the scaling factor on your delay parameter wrong.
- nothing at all for a minute, then all the output you were expecting => use std::flush.
Posting you C++ attempt rather than the Python you cribbed from would have been more useful.
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
int a = 60;
cout<< "Ready to Count Down:";
while (a>0)
{
cout<<a;
sleep(1); // "Use of undeclared identifier 'sleep'" ERROR.
a--;
}
return 0;
#include<iostream>
#include <windows.h>
usingnamespace std;
int main()
{
cout<<"There will be a pause after this phrase\n";
Sleep(3000)
cout<<"Told you...";
}
The number you input in parenthesis is millisecond (1000 ms = 1 sec)
S in Sleep has to be capital
I think I read somewhere the there are Windows compatibility problems with std::this_thread::sleep_for and an alternative is to call Sleep from synchapi.h.