|
|
|
|
|
|
b*******s 发帖数: 5216 | 1 #include
#include
#include
#include
using namespace std;
using namespace std::chrono;
high_resolution_clock::time_point get_tick()
{
return high_resolution_clock::now();
}
int main()
{
using check = future;
deque checks;
for (uint64_t loop = 0;loop < 1000;++loop)
{
checks.push_back(async(launch::async,get_tick));
}
high_resolution_clock::time_point prev = checks[0].get();
checks.pop_front();
for (auto& item : checks)
{
high_resolution_clock::time_point cur = item.get();
duration gap = duration_cast>(cur - prev);
prev = cur;
cout << gap.count() << endl;
}
return 0;
} | N******K 发帖数: 10202 | 2 倒腾啥呢?
【在 b*******s 的大作中提到】 : #include : #include : #include : #include : using namespace std; : using namespace std::chrono; : high_resolution_clock::time_point get_tick() : { : return high_resolution_clock::now(); : }
| b*******s 发帖数: 5216 | 3 it is for detecting is there any thread pool under the hood
【在 N******K 的大作中提到】 : 倒腾啥呢?
|
|
|
|
|
|