Measure the time to use the StatusOr factory, evaluate the result, and invoke the trivial function.
| 563 | // Measure the time to use the StatusOr<T*> factory, evaluate the result, |
| 564 | // and invoke the trivial function. |
| 565 | void BM_StatusOrFactory(int iters) { |
| 566 | tensorflow::testing::StopTiming(); |
| 567 | BenchmarkFactory<BenchmarkType> factory; |
| 568 | tensorflow::testing::StartTiming(); |
| 569 | for (int i = 0; i != iters; ++i) { |
| 570 | StatusOr<BenchmarkType*> result = factory.StatusOrFactory(); |
| 571 | if (result.ok()) { |
| 572 | result.ValueOrDie()->DoWork(); |
| 573 | } |
| 574 | } |
| 575 | } |
| 576 | BENCHMARK(BM_StatusOrFactory); |
| 577 | |
| 578 | // Measure the time taken to call into the factory, providing an |
nothing calls this directly
no test coverage detected