Add support for returning number of benchmark iterations
Summary: I'm looping through a large number of test cases in a benchmark and I'm interested in the average time per test case rather than the total time, which is what I'm currently seeing. In order to get the average time, I need to be able to tell the benchmark module how many iterations have been run. This change adds _MULTI variants of the different BENCHMARK_ macros that allow for returning the actual number of iterations that have been run, e.g.: BENCHMARK_MULTI(benchmarkSomething) { std::vector<int> testCases { 0, 1, 1, 2, 3, 5 }; for (int c : testCases) { doSomething(c); } return testCases.size(); } Test Plan: * fbconfig -r folly && fbmake runtests * added new test cases to example benchmark code Reviewed By: simpkins@fb.com Subscribers: folly@lists, london_search@ FB internal diff: D1356437
Showing
Please register or sign in to comment