基准 一个用于对代码段进行基准测试的库,类似于单元测试。 例子: # include < benchmark> static void BM_SomeFunction (benchmark::State& state) { // Perform setup here for ( auto _ : state) { // This code gets timed SomeFunction (); } } // Register the function as a benchmark BENCHMARK (BM_SomeFunction); // Run the b