| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // Some portions Copyright (c) 2009 The Chromium Authors. | |
| 5 | 4 |
| 6 #include "microbenchmark/microbenchmark.h" | 5 #include "microbenchmark/microbenchmark.h" |
| 7 | 6 |
| 8 namespace chromeos { | 7 namespace chromeos { |
| 9 // Commandline switch used to override the default number of runs for all | 8 // Commandline switch used to override the default number of runs for all |
| 10 // tests. | 9 // tests. |
| 11 const char *Microbenchmark::kRunsSwitch = "microbenchmark-runs"; | 10 const char *Microbenchmark::kRunsSwitch = "microbenchmark-runs"; |
| 12 | 11 |
| 13 void Microbenchmark::Run(uint64 number_of_runs) { | 12 void Microbenchmark::Run(uint64 number_of_runs) { |
| 14 runs_ = number_of_runs; | 13 runs_ = number_of_runs; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 << name() << "-scaffold," | 46 << name() << "-scaffold," |
| 48 << runs() << "," | 47 << runs() << "," |
| 49 << scaffold_total_nanoseconds() << "," | 48 << scaffold_total_nanoseconds() << "," |
| 50 << scaffold_per_run_nanoseconds() << "\nMB:" | 49 << scaffold_per_run_nanoseconds() << "\nMB:" |
| 51 << name() << "," | 50 << name() << "," |
| 52 << runs() << "," | 51 << runs() << "," |
| 53 << total_nanoseconds() << "," | 52 << total_nanoseconds() << "," |
| 54 << per_run_nanoseconds() << "\nMB:" | 53 << per_run_nanoseconds() << "\nMB:" |
| 55 << name() << "-adjusted," | 54 << name() << "-adjusted," |
| 56 << runs() << "," | 55 << runs() << "," |
| 57 << total_nanoseconds() - scaffold_total_nanoseconds() << "" | 56 << total_nanoseconds() - scaffold_total_nanoseconds() << "," |
| 58 << per_run_nanoseconds() - scaffold_per_run_nanoseconds() | 57 << per_run_nanoseconds() - scaffold_per_run_nanoseconds() |
| 59 << "\n"; | 58 << "\n"; |
| 60 } | 59 } |
| 61 | 60 |
| 62 // Hide away helper functions here. | 61 // Hide away helper functions here. |
| 63 namespace microbenchmark_helper { | 62 namespace microbenchmark_helper { |
| 64 // Empty setup function. | 63 // Empty setup function. |
| 65 void NoSetup(uint64) { } | 64 void NoSetup(uint64) { } |
| 66 | 65 |
| 67 } // namespace microbenchmark_helper | 66 } // namespace microbenchmark_helper |
| 68 } // namespace chromeos | 67 } // namespace chromeos |
| 69 | 68 |
| OLD | NEW |