| 216 | } |
| 217 | |
| 218 | void 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 | |
| 243 | void test_async_1(Mama* ma /*, Child* tom, Child* rose, Child* jean*/) |
| 244 | { |