diff --git a/main.cpp b/main.cpp index 8ab01a3..b516e17 100644 --- a/main.cpp +++ b/main.cpp @@ -1,9 +1,14 @@ #include #include +#include -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));