#include <future>
#include <chrono>
#include <iostream>

using namespace std;
using namespace std::chrono;

int main()
{
  const auto start_time = steady_clock::now();

  async(launch::async, [] { this_thread::sleep_for(seconds(2)); });
  async(launch::async, [] { this_thread::sleep_for(seconds(2)); });
  auto f = async(launch::async, [] { this_thread::sleep_for(seconds(2)); });
  f.wait();

  const auto end_time = steady_clock::now();

  cout << duration_cast<milliseconds>(end_time - start_time).count() << '\n';
}
