| 1 |
#include "cmMod.hpp" |
| 2 |
|
| 3 |
#include <chrono> |
| 4 |
#include <thread> |
| 5 |
|
| 6 |
using namespace std::chrono_literals; |
| 7 |
|
| 8 |
void CmMod::asyncIncrement() { |
| 9 |
std::thread t1([this]() { |
| 10 |
std::this_thread::sleep_for(100ms); |
| 11 |
num += 1; |
| 12 |
}); |
| 13 |
|
| 14 |
t1.join(); |
| 15 |
} |