| 28 | namespace tfprof { |
| 29 | namespace { |
| 30 | string FormatToalExecTime(const ShowMultiNode* node, |
| 31 | const ShowMultiNode* root) { |
| 32 | double accu_pct = 0.0; |
| 33 | double pct = 0.0; |
| 34 | if (node->proto().total_exec_micros() > 0) { |
| 35 | accu_pct = 100.0 * node->proto().total_exec_micros() / |
| 36 | root->proto().total_exec_micros(); |
| 37 | pct = |
| 38 | 100.0 * node->proto().exec_micros() / root->proto().total_exec_micros(); |
| 39 | } |
| 40 | |
| 41 | return strings::Printf( |
| 42 | "%30s", strings::Printf("%s (%.2f%%, %.2f%%)", |
| 43 | FormatTime(node->proto().exec_micros()).c_str(), |
| 44 | accu_pct, pct) |
| 45 | .c_str()); |
| 46 | } |
| 47 | string FormatCPUExecTime(const ShowMultiNode* node, const ShowMultiNode* root) { |
| 48 | double accu_pct = 0.0; |
| 49 | double pct = 0.0; |
no test coverage detected