MCPcopy Create free account
hub / github.com/apache/brpc / sleep_func

Function sleep_func

test/brpc_coroutine_unittest.cpp:106–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106Awaitable<int> sleep_func() {
107 Trace t("sleep_func");
108 int64_t s = butil::monotonic_time_us();
109 auto aw = Coroutine::usleep(1000);
110 usleep(delay_us);
111 co_await aw;
112 int cost = butil::monotonic_time_us() - s;
113 EXPECT_GE(cost, 1000);
114 LOG(INFO) << "after usleep:" << cost;
115 co_return 123;
116}
117
118Awaitable<float> exception_func() {
119 Trace t("exception_func");

Callers 2

funcFunction · 0.85
TEST_FFunction · 0.85

Calls 1

monotonic_time_usFunction · 0.85

Tested by

no test coverage detected