| 783 | } |
| 784 | |
| 785 | static void BM_Convert(benchmark::State& state, const BenchmarkConfig& config, |
| 786 | int iteration) { |
| 787 | std::ostringstream os; |
| 788 | for (int i = 0; i < iteration; i++) { |
| 789 | os << "Open Chinese Convert 開放中文轉換" << i << std::endl; |
| 790 | } |
| 791 | const std::string text = os.str(); |
| 792 | const std::unique_ptr<SimpleConverter> converter(Initialize(config)); |
| 793 | for (auto _ : state) { |
| 794 | Convert(converter.get(), text); |
| 795 | } |
| 796 | SetThroughputCounter(state, text.size()); |
| 797 | } |
| 798 | |
| 799 | static void BM_CommandLineLongText(benchmark::State& state, |
| 800 | const BenchmarkConfig& config) { |
no test coverage detected