MCPcopy Create free account
hub / github.com/OAID/Tengine / TestMessageBus_2

Function TestMessageBus_2

internal/tests/core/test/test_message_bus.cpp:218–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218void TestMessageBus_2()
219{
220 Mama ma(false);
221 Child tom(false, string("Tom"), string("Delicious!"));
222 Child rose(false, string("Rose"), string("Just so so!"));
223 Child jean(false, string("Jean"), string("Terrible!"));
224 ma.Cooking();
225 {
226 Timer tm;
227#if 0
228 std::shared_future<void> task = std::async(std::launch::async/*deferred*/, //std::launch::async
229 test_async, &ma, &tom, &rose, &jean
230 );
231 task.get();
232#else
233 int64_t i = 0;
234 while(i++ < 100000L)
235 {
236 ma.Cooking();
237 }
238#endif
239 cerr << 100000L * 1000 / tm.elapsed_ms() << "times/s\n";
240 }
241}
242
243void test_async_1(Mama* ma /*, Child* tom, Child* rose, Child* jean*/)
244{

Callers 1

mainFunction · 0.85

Calls 2

CookingMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected