| 543 | } |
| 544 | |
| 545 | std::string FormatTimeValue(double time) { |
| 546 | std::ostringstream os; |
| 547 | if (time < 1.0) { |
| 548 | os << std::fixed << std::setprecision(3) << time; |
| 549 | } else if (time < 10.0) { |
| 550 | os << std::fixed << std::setprecision(2) << time; |
| 551 | } else if (time < 100.0) { |
| 552 | os << std::fixed << std::setprecision(1) << time; |
| 553 | } else if (time > 9999999999.0) { |
| 554 | os << std::scientific << std::setprecision(4) << time; |
| 555 | } else { |
| 556 | os << std::fixed << std::setprecision(0) << time; |
| 557 | } |
| 558 | return os.str(); |
| 559 | } |
| 560 | |
| 561 | std::string FormatThroughputValue(const benchmark::BenchmarkReporter::Run& run) { |
| 562 | const auto it = run.counters.find("Throughput"); |