add CLI params

This commit is contained in:
Erik Bročko 2022-05-29 22:59:56 +02:00
parent 2c0dc2aa70
commit d183bc7142
Signed by: ericek111
GPG Key ID: 414DED726771329C

View File

@ -1,9 +1,14 @@
#include <MyThreadPool.h>
#include <iostream>
#include <string>
int main()
int main(int argc, char* argv[])
{
MyThreadPool::ThreadPool tp(4);
size_t threadCount = 0;
if (argc > 1) {
threadCount = std::stoul(argv[1]);
}
MyThreadPool::ThreadPool tp(threadCount);
auto task = [](int i) {
std::this_thread::sleep_for(std::chrono::milliseconds(500));