I want to pause the execution of c++ program for 5 seconds. In android Handler.postDelayed has the required functionality what I am looking for. Is there anything similar to
#include #include #include int main() { std::cout << "Hello waiter" << std::endl; std::chrono::seconds dura( 5); std::this_thread::sleep_for( dura ); std::cout << "Waited 5s\n"; }
this_thread::sleep_for Blocks the execution of the current thread for at least the specified sleep_duration.
this_thread::sleep_for