21 #include <glog/logging.h> 29 throw std::runtime_error(
"");
36 for (
int i = 0;
i < iters * 100; ++
i) {
39 }
catch (
const std::exception& e) {
46 std::vector<std::thread>
threads;
48 threads.resize(kNumThreads);
49 for (
auto&
t : threads) {
50 t = std::thread([iters]() {
loop(iters); });
52 for (
auto&
t : threads) {
58 gflags::ParseCommandLineFlags(&argc, &argv,
true);
59 google::InitGoogleLogging(argv[0]);
int main(int argc, char *argv[])
static size_t const kNumThreads
std::vector< std::thread::id > threads
std::vector< ExceptionInfo > getCurrentExceptions()
BENCHMARK(ExceptionTracer, iters)
auto doNotOptimizeAway(const T &datum) -> typename std::enable_if< !detail::DoNotOptimizeAwayNeedsIndirect< T >::value >::type