Is there a c++ function like time.sleep() in python? 10 points.?

2 Answers

  • Anonymous
    9 years ago
    Favorite Answer

    Yes Use the dos.h header file

    and u can use sleep function .

    Usage: sleep(seconds);

  • oops
    Lv 6
    9 years ago

    In the new c++ standard, there is sleep_for:

        #include <thread>

        #include <chrono>

        int main()





    If that's not available to you, boost has a version:

        #include <boost/thread.hpp>

        int main()



                boost::posix_time ::seconds(5));


Still have questions? Get your answers by asking now.