| 30 | namespace tensorflow { |
| 31 | namespace tfprof { |
| 32 | string FormatNumber(int64 n) { |
| 33 | if (n < 1000) { |
| 34 | return strings::Printf("%lld", n); |
| 35 | } else if (n < 1000000) { |
| 36 | return strings::Printf("%.2fk", n / 1000.0); |
| 37 | } else if (n < 1000000000) { |
| 38 | return strings::Printf("%.2fm", n / 1000000.0); |
| 39 | } else { |
| 40 | return strings::Printf("%.2fb", n / 1000000000.0); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | string FormatTime(int64 micros) { |
| 45 | if (micros < 1000) { |
no test coverage detected