Two Temporaries
using namespace std::chrono;
using namespace std::chrono_literals;
void work(int id) { std::this_thread::sleep_for(1s); }
int main() {
auto t0 = steady_clock::now();
std::async(std::launch::async, work, 1);
std::async(std::launch::async, work, 2);
std::cout << duration_cast<milliseconds>(steady_clock::now() - t0).count() << "\n";
}
The machine has 8 idle cores. Roughly what does this print?
Sign in to answer questions and track your progress
Sign In