BENCHMARK(std::to_string(threadsCount))
{
+ threads.clear();
for (size_t idx = 0U; idx < threadsCount; idx++) {
- threads.emplace_back(std::thread(testCode, iterations / threadsCount));
+ threads.emplace_back(testCode, iterations / threadsCount);
}
for (auto& thread : threads) {
thread.join();
BENCHMARK(std::to_string(threadsCount))
{
+ threads.clear();
for (size_t idx = 0U; idx < threadsCount; idx++) {
- threads.emplace_back(std::thread(testCode, iterations / threadsCount));
+ threads.emplace_back(testCode, iterations / threadsCount);
}
for (auto& thread : threads) {
thread.join();