Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit 8795faa

Browse files
author
Luc Sinet
committed
develop #comment Add build status to the README.
- Crop logo. - Use chrono literals in the examples.
1 parent 1807afe commit 8795faa

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
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+
35
TaskManager 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).
2126
Task::Module::init(2);
@@ -47,8 +52,8 @@ auto scheduler = Task::Module::makeScheduler(1);
4752
size_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.
5459
future.get()

assets/task_manager_logo.png

-259 Bytes
Loading

0 commit comments

Comments
 (0)