在一个空闲的多核环境下,以下c++代码运行时间为?(精确到秒)#inclu...
发布于 2022-03-03 16:26:39
在一个空闲的多核环境下,以下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
}
登录后免费查看答案
关注者
0
被浏览
9