| 14 | } |
| 15 | } |
| 16 | function getCSSWidth(stat, endStat) { |
| 17 | let width = 0; |
| 18 | if (totalTime !== 0) { |
| 19 | width = |
| 20 | ((performance.timing[endStat] - performance.timing[stat]) / |
| 21 | totalTime) * |
| 22 | 100.0; |
| 23 | } |
| 24 | const denominator = 100.0 - getLeft(stat); |
| 25 | if (denominator !== 0) { |
| 26 | // Calculate relative percent (same as sql panel logic) |
| 27 | width = (100.0 * width) / denominator; |
| 28 | } else { |
| 29 | width = 0; |
| 30 | } |
| 31 | return width < 1 ? "2px" : width + "%"; |
| 32 | } |
| 33 | function addRow(tbody, stat, endStat) { |
| 34 | const row = document.createElement("tr"); |
| 35 | if (endStat) { |