BenchmarkSuspender::dismissing.
Summary:
[Folly] BenchmarkSuspender::dismissing.
Pass a lambda to it, and the lambda will be executed while the benchmark-suspender is dismissed. Just a bit of sugar around `BenchmarkSuspender::dismiss` and `BenchmarkSuspender::rehire`.
BENCHMARK(name_void, iters) {
BenchmarkSuspender braces;
# benchmark timer is suspended
braces.dismissing([&] {
# benchmark timer is running
doSomething();
});
# benchmark timer is suspended
}
BENCHMARK(name_value, iters) {
BenchmarkSuspender braces;
# benchmark timer is suspended
auto value = braces.dismissing([&] {
# benchmark timer is running
return doSomething();
});
# benchmark timer is suspended
}
Test Plan:
Unit tests:
* `folly/test/BenchmarkTest.cpp` (actually a benchmark)
Reviewed By: njormrod@fb.com
Subscribers: net-systems@, folly-diffs@, yfeldblum, chalfant
FB internal diff:
D2024166
Signature: t1:
2024166:
1430163281:
24df0ac98cbe36372f780372ee8f7dd3722b7868