在一个空闲的多核环境下,以下c++代码运行时间为?(精确到秒) #include <iostream>
#include <future>
#include <thread>
using namespace std::literals::chrono_literals;
void foo(int n) { std::this_thread::sleep_for(n * 1s); }
int main(){
std::async( std::launch::async, foo, 10 );
std::async( std::launch::async, foo, 5 );
return 0;
}