MCPcopy Create free account
hub / github.com/alibaba/async_simple / delayedTask

Method delayedTask

async_simple/uthread/test/UthreadTest.cpp:42–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41 template <class Func>
42 void delayedTask(Func&& func, std::size_t ms) {
43 std::thread(
44 [f = std::move(func), ms](Executor* ex) {
45 std::this_thread::sleep_for(std::chrono::milliseconds(ms));
46 ex->schedule(std::move(f));
47 },
48 &_executor)
49 .detach();
50 }
51
52 template <class T>
53 struct Awaiter {

Callers

nothing calls this directly

Calls 3

threadClass · 0.85
detachMethod · 0.45
scheduleMethod · 0.45

Tested by

no test coverage detected