| 53 | } |
| 54 | |
| 55 | std::string openhd::bits_per_second_to_string(uint64_t bits_per_second) { |
| 56 | const auto mBits_per_second = |
| 57 | static_cast<double>(bits_per_second) / (1000.0 * 1000.0); |
| 58 | std::stringstream ss; |
| 59 | ss.precision(2); |
| 60 | if (mBits_per_second > 1) { |
| 61 | ss << mBits_per_second << "mBit/s"; |
| 62 | return ss.str(); |
| 63 | } |
| 64 | const auto kBits_per_second = static_cast<float>(bits_per_second) / 1000; |
| 65 | ss << kBits_per_second << "kBit/s"; |
| 66 | return ss.str(); |
| 67 | } |
| 68 | |
| 69 | std::string openhd::bytes_per_second_to_string(double bytes_per_second) { |
| 70 | const auto bits_per_second = bytes_per_second * 8; |
nothing calls this directly
no outgoing calls
no test coverage detected