How can I stop the execution flow at a specific point for some time (I need a few seconds) ? I need this for an interactive story telling game, running at console.
#include <iostream>
#include <chrono>
#include <thread>
int main()
{
auto sleepDuration = std::chrono::seconds(2);
std::cout << "Once upon a time, there was a boy." << std::endl;
std::this_thread::sleep_for(sleepDuration);
std::cout << "He was cool." << std::endl;
std::this_thread::sleep_for(sleepDuration);
std::cout << "The end." << std::endl;
}