is there a timed-release function?

cout<<"What is your name?"<<endl;
cin>>MyName;
cout<<"You're name is " << MyName << "? Ok."<<endl;
cout<<endl;

Before the program returns the user input, is there any function that has a timer so to speak?

I wanted the output to say

Processing...

...

AND THEN give the result?
Last edited on
std::this_thread::sleep_for(std::chrono::seconds(x));

You'll need C++11, #include <chrono>, #include <thread>
I must be even before the title beginner. I don't know what STD, thread or chrono, is. What the #include means... and definitely not how to implement any of these..... and what do the semi colons mean?

sigh... *facepalm*
Well the double colons express that you are accessing a certain namespace scope.

std is the name of the entire c++ standard library, all standard functions and classes are in this namespace. To access the standard library, we thus use std::

#include <x>

Is a "macro", the pre-compiler simply pastes the contents of file x into the code where you have stated "#include <x>".

thread and chrono are std libraries, including them into your code gives you access to use their functions and classes.
Thank you for your answers. Very helpful. :)
Topic archived. No new replies allowed.