This repository was archived by the owner on Apr 3, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11![ alt text] ( https://raw.githubusercontent.com/Tastyep/TaskManager/master/assets/task_manager_logo.png )
22
3+ [ ![ Build Status] ( https://travis-ci.org/Tastyep/TaskManager.svg?branch=master )] ( https://travis-ci.org/Tastyep/TaskManager )
4+
35TaskManager is an asynchronous task management library using the features of C++14.
46
57### Requirements
@@ -16,6 +18,9 @@ A compiler supporting the C++14 features.
1618
1719### Basic Usage
1820###### Manager
21+
22+ Note: The following examples use chrono literals.
23+
1924``` C++
2025// Create the thread pool with the initial number of threads (2 here).
2126Task::Module::init (2);
@@ -47,8 +52,8 @@ auto scheduler = Task::Module::makeScheduler(1);
4752size_t n = 0;
4853
4954// Add new tasks and get the future.
50- auto future = scheduler.scheduleIn("Task1", std::chrono::seconds(2) , [&n] { n++; });
51- scheduler.scheduleIn("Task2", std::chrono::seconds(1) , [&n] { n = 41 });
55+ auto future = scheduler.scheduleIn("Task1", 2s , [&n] { n++; });
56+ scheduler.scheduleIn("Task2", 1s , [&n] { n = 41 });
5257
5358// Get the future and print the updated value.
5459future.get()
You can’t perform that action at this time.
0 commit comments