MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / FormatTimeValue

Function FormatTimeValue

src/benchmark/Performance.cpp:545–559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543}
544
545std::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
561std::string FormatThroughputValue(const benchmark::BenchmarkReporter::Run& run) {
562 const auto it = run.counters.find("Throughput");

Callers 1

PrintRunDataMethod · 0.85

Calls 1

strMethod · 0.45

Tested by

no test coverage detected