Console Program in C++
Question: I was recently messing around with c++ console programming. I was wondering if
there was a way to make text appear on the console for a specific amount of
time, then go to some more text. Essentially, I'm trying to create a timer
object. Or if you're familiar with python, it would be something like

    
    
    import timer
    
    print "Hello World"
    timer.sleep(2)
    print "Hello Again World"
    timer.sleep(2)
    

If someone could help me with this, I would appreciate it, thanks in advance.


Answer: Before C++11 there was no standard way to do it, either use a system library
or use a cross platform library that wraps system libraries for you. In C++ 11
it takes the thread, and chrono libraries to get it done.

    
    
    #include <iostream>
    #include <chrono>
    #include <thread>
    int main()
    {
        std::cout << "Hello world" << std::endl;
        std::chrono::milliseconds twoSeconds( 2000 );
        std::this_thread::sleep_for( twoSeconds);
        std::cout << "Hello Again World" << std::endl;
    }
    

