File tree 1 file changed +13
-2
lines changed
debug_toolbar/static/debug_toolbar/js
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -31,16 +31,27 @@ function insertBrowserTiming() {
31
31
}
32
32
function addRow ( tbody , stat , endStat ) {
33
33
const row = document . createElement ( "tr" ) ;
34
+ const elapsed = performance . timing [ stat ] - timingOffset ;
34
35
if ( endStat ) {
36
+ const duration =
37
+ performance . timing [ endStat ] - performance . timing [ stat ] ;
35
38
// Render a start through end bar
36
- row . innerHTML = `<td>${ stat . replace ( "Start" , "" ) } </td><td><svg class="djDebugLineChart" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 100 5" preserveAspectRatio="none"><rect y="0" height="5" fill="#ccc" /></svg></td><td>${ performance . timing [ stat ] - timingOffset } (+${ performance . timing [ endStat ] - performance . timing [ stat ] } )</td>` ;
39
+ row . innerHTML = `
40
+ <td>${ stat . replace ( "Start" , "" ) } </td>
41
+ <td><svg class="djDebugLineChart" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 100 5" preserveAspectRatio="none"><rect y="0" height="5" fill="#ccc" /></svg></td>
42
+ <td>${ elapsed } (+${ duration } )</td>
43
+ ` ;
37
44
row . querySelector ( "rect" ) . setAttribute (
38
45
"width" ,
39
46
getCSSWidth ( stat , endStat )
40
47
) ;
41
48
} else {
42
49
// Render a point in time
43
- row . innerHTML = `<td>${ stat } </td><td><svg class="djDebugLineChart" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 100 5" preserveAspectRatio="none"><rect y="0" height="5" fill="#ccc" /></svg></td><td>${ performance . timing [ stat ] - timingOffset } </td>` ;
50
+ row . innerHTML = `
51
+ <td>${ stat } </td>
52
+ <td><svg class="djDebugLineChart" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 100 5" preserveAspectRatio="none"><rect y="0" height="5" fill="#ccc" /></svg></td>
53
+ <td>${ elapsed } </td>
54
+ ` ;
44
55
row . querySelector ( "rect" ) . setAttribute ( "width" , 2 ) ;
45
56
}
46
57
row . querySelector ( "rect" ) . setAttribute ( "x" , getLeft ( stat ) ) ;
You can’t perform that action at this time.
0 commit comments