mirror of
https://github.com/google/benchmark.git
synced 2024-11-26 07:32:19 +00:00
Fixes #357: broken RMS values when time unit is set.
This commit is contained in:
parent
17298b2dc0
commit
ea26e62a0d
|
@ -295,6 +295,11 @@ std::vector<BenchmarkReporter::Run> ComputeBigO(
|
|||
big_o.report_big_o = true;
|
||||
big_o.complexity = result_cpu.complexity;
|
||||
|
||||
// All the time results are reported after being multiplied by the
|
||||
// time unit multiplier. But since RMS is a relative quantity it
|
||||
// should not be multiplied at all. So, here, we _divide_ it by the
|
||||
// multiplier so that when it is multiplied later the result is the
|
||||
// correct one.
|
||||
double multiplier = GetTimeUnitMultiplier(reports[0].time_unit);
|
||||
|
||||
// Only add label to mean/stddev if it is same for all runs
|
||||
|
@ -307,6 +312,9 @@ std::vector<BenchmarkReporter::Run> ComputeBigO(
|
|||
rms.cpu_accumulated_time = result_cpu.rms / multiplier;
|
||||
rms.report_rms = true;
|
||||
rms.complexity = result_cpu.complexity;
|
||||
// don't forget to keep the time unit, or we won't be able to
|
||||
// recover the correct value.
|
||||
rms.time_unit = reports[0].time_unit;
|
||||
|
||||
results.push_back(big_o);
|
||||
results.push_back(rms);
|
||||
|
|
Loading…
Reference in a new issue