@@ -298,6 +298,42 @@ ADD_COMPLEXITY_CASES(n_ms_test_name, big_o_n_ms_test_name, rms_o_n_ms_test_name,
298298 enum_auto_big_o_n, /* family_index=*/ 10 , " ms" ,
299299 " 1\\ .[0-9]+e-03" );
300300
301+ void BM_Complexity_O1_ZeroTime (benchmark::State& state) {
302+ for (auto _ : state) {
303+ state.SetIterationTime (0.0 );
304+ }
305+ state.SetComplexityN (state.range (0 ));
306+ }
307+ BENCHMARK (BM_Complexity_O1_ZeroTime)
308+ ->Range (1 , 2 )
309+ ->UseManualTime()
310+ ->Complexity(benchmark::o1);
311+ BENCHMARK (BM_Complexity_O1_ZeroTime)
312+ ->Range (1 , 2 )
313+ ->UseManualTime()
314+ ->Complexity();
315+ BENCHMARK (BM_Complexity_O1_ZeroTime)
316+ ->Range (1 , 2 )
317+ ->UseManualTime()
318+ ->Complexity([](benchmark::IterationCount) { return 1.0 ; });
319+
320+ constexpr char one_test_name_zero_time[] =
321+ " BM_Complexity_O1_ZeroTime/manual_time" ;
322+ constexpr char big_o_1_test_name_zero_time[] =
323+ " BM_Complexity_O1_ZeroTime/manual_time_BigO" ;
324+ constexpr char rms_o_1_test_name_zero_time[] =
325+ " BM_Complexity_O1_ZeroTime/manual_time_RMS" ;
326+
327+ ADD_COMPLEXITY_CASES (one_test_name_zero_time, big_o_1_test_name_zero_time,
328+ rms_o_1_test_name_zero_time, enum_auto_big_o_1, 11 , " ns" ,
329+ " %float" );
330+ ADD_COMPLEXITY_CASES (one_test_name_zero_time, big_o_1_test_name_zero_time,
331+ rms_o_1_test_name_zero_time, enum_auto_big_o_1, 12 , " ns" ,
332+ " %float" );
333+ ADD_COMPLEXITY_CASES (one_test_name_zero_time, big_o_1_test_name_zero_time,
334+ rms_o_1_test_name_zero_time, lambda_big_o_1, 13 , " ns" ,
335+ " %float" );
336+
301337} // end namespace
302338
303339// ========================================================================= //
0 commit comments