MCPcopy Create free account
hub / github.com/David-Haim/concurrencpp / delayed_task

Function delayed_task

example/12_delay_object/source/main.cpp:7–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5using namespace std::chrono_literals;
6
7concurrencpp::null_result delayed_task(std::shared_ptr<concurrencpp::timer_queue> tq,
8 std::shared_ptr<concurrencpp::thread_pool_executor> ex) {
9 size_t counter = 1;
10
11 while (true) {
12 std::cout << "task was invoked " << counter << " times." << std::endl;
13 counter++;
14
15 co_await tq->make_delay_object(1500ms, ex);
16 }
17}
18
19int main() {
20 concurrencpp::runtime runtime;

Callers 1

mainFunction · 0.85

Calls 1

make_delay_objectMethod · 0.80

Tested by

no test coverage detected