MCPcopy Create free account
hub / github.com/Codesire-Deng/co_context / cycle

Function cycle

example/timer.cpp:5–10  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3using namespace co_context;
4
5task<> cycle(int sec, const char *message) {
6 while (true) {
7 co_await timeout(std::chrono::seconds{sec});
8 printf("%s\n", message);
9 }
10}
11
12task<> cycle_abs(int sec, const char *message) {
13 auto next = std::chrono::steady_clock::now();

Callers 1

mainFunction · 0.85

Calls 1

timeoutFunction · 0.85

Tested by

no test coverage detected