@@ -107,7 +107,8 @@ ADD_CASES(TC_CSVOut, {{"^\"BM_Counters_WithBytesAndItemsPSec/threads:%int\","
107107// VS2013 does not allow this function to be passed as a lambda argument
108108// to CHECK_BENCHMARK_RESULTS()
109109void CheckBytesAndItemsPSec (Results const & e) {
110- double t = e.DurationCPUTime (); // this (and not real time) is the time used
110+ // this (and not real time) is the time used
111+ double t = e.DurationCPUTime () / e.NumThreads ();
111112 CHECK_COUNTER_VALUE (e, int , " foo" , EQ, 1 * e.NumThreads ());
112113 // check that the values are within 0.1% of the expected values
113114 CHECK_FLOAT_RESULT_VALUE (e, " bytes_per_second" , EQ,
@@ -158,7 +159,8 @@ ADD_CASES(TC_CSVOut,
158159// VS2013 does not allow this function to be passed as a lambda argument
159160// to CHECK_BENCHMARK_RESULTS()
160161void CheckRate (Results const & e) {
161- double t = e.DurationCPUTime (); // this (and not real time) is the time used
162+ // this (and not real time) is the time used
163+ double t = e.DurationCPUTime () / e.NumThreads ();
162164 // check that the values are within 0.1% of the expected values
163165 CHECK_FLOAT_COUNTER_VALUE (e, " foo" , EQ, (1 . * e.NumThreads ()) / t, 0.001 );
164166 CHECK_FLOAT_COUNTER_VALUE (e, " bar" , EQ, (2 . * e.NumThreads ()) / t, 0.001 );
@@ -258,7 +260,8 @@ ADD_CASES(TC_CSVOut, {{"^\"BM_Counters_InvertedRate/"
258260// VS2013 does not allow this function to be passed as a lambda argument
259261// to CHECK_BENCHMARK_RESULTS()
260262void CheckInvertedRate (Results const & e) {
261- double t = e.DurationCPUTime (); // this (and not real time) is the time used
263+ // this (and not real time) is the time used
264+ double t = e.DurationCPUTime () / e.NumThreads ();
262265 // check that the values are within 0.1% of the expected values
263266 CHECK_FLOAT_COUNTER_VALUE (e, " foo" , EQ, t / (e.NumThreads ()), 0.001 );
264267 CHECK_FLOAT_COUNTER_VALUE (e, " bar" , EQ, t / (8192.0 * e.NumThreads ()), 0.001 );
@@ -394,8 +397,10 @@ ADD_CASES(TC_CSVOut, {{"^\"BM_Counters_AvgThreadsRate/"
394397// VS2013 does not allow this function to be passed as a lambda argument
395398// to CHECK_BENCHMARK_RESULTS()
396399void CheckAvgThreadsRate (Results const & e) {
397- CHECK_FLOAT_COUNTER_VALUE (e, " foo" , EQ, 1 . / e.DurationCPUTime (), 0.001 );
398- CHECK_FLOAT_COUNTER_VALUE (e, " bar" , EQ, 2 . / e.DurationCPUTime (), 0.001 );
400+ // this (and not real time) is the time used
401+ double t = e.DurationCPUTime () / e.NumThreads ();
402+ CHECK_FLOAT_COUNTER_VALUE (e, " foo" , EQ, 1 . / t, 0.001 );
403+ CHECK_FLOAT_COUNTER_VALUE (e, " bar" , EQ, 2 . / t, 0.001 );
399404}
400405CHECK_BENCHMARK_RESULTS (" BM_Counters_AvgThreadsRate/threads:%int" ,
401406 &CheckAvgThreadsRate);
@@ -496,7 +501,8 @@ ADD_CASES(
496501// to CHECK_BENCHMARK_RESULTS()
497502void CheckIsIterationInvariantRate (Results const & e) {
498503 double its = e.NumIterations ();
499- double t = e.DurationCPUTime (); // this (and not real time) is the time used
504+ // this (and not real time) is the time used
505+ double t = e.DurationCPUTime () / e.NumThreads ();
500506 // check that the values are within 0.1% of the expected values
501507 CHECK_FLOAT_COUNTER_VALUE (e, " foo" , EQ, its * 1 . * e.NumThreads () / t, 0.001 );
502508 CHECK_FLOAT_COUNTER_VALUE (e, " bar" , EQ, its * 2 . * e.NumThreads () / t, 0.001 );
@@ -596,7 +602,8 @@ ADD_CASES(TC_CSVOut,
596602// to CHECK_BENCHMARK_RESULTS()
597603void CheckAvgIterationsRate (Results const & e) {
598604 double its = e.NumIterations ();
599- double t = e.DurationCPUTime (); // this (and not real time) is the time used
605+ // this (and not real time) is the time used
606+ double t = e.DurationCPUTime () / e.NumThreads ();
600607 // check that the values are within 0.1% of the expected values
601608 CHECK_FLOAT_COUNTER_VALUE (e, " foo" , EQ, 1 . * e.NumThreads () / its / t, 0.001 );
602609 CHECK_FLOAT_COUNTER_VALUE (e, " bar" , EQ, 2 . * e.NumThreads () / its / t, 0.001 );
0 commit comments