|
4 | 4 | Perf.setCurrentRev(); |
5 | 5 | Perf.pageLoadStart = Date.now(); |
6 | 6 |
|
| 7 | + $( document ).bind( "mobileinit", function() { |
| 8 | + Perf.pageProcessingStart = Date.now(); |
| 9 | + }); |
| 10 | + |
7 | 11 | $listPage.live( "pagebeforecreate", function() { |
8 | 12 | if( firstCounter == 0 ) { |
9 | 13 | Perf.pageCreateStart = Date.now(); |
10 | 14 | firstCounter++; |
11 | 15 | } |
12 | 16 | }); |
13 | 17 |
|
| 18 | + $listPage.live( "pagecreate", function( event ) { |
| 19 | + if( event.target !== $("#list-page")[0] ){ |
| 20 | + return; |
| 21 | + } |
| 22 | + |
| 23 | + Perf.pageEnhanceStart = Date.now(); |
| 24 | + }); |
| 25 | + |
14 | 26 | $listPage.live( "pageinit", function( event ) { |
15 | 27 | // if a child page init is fired ignore it, we only |
16 | 28 | // want the top level page init event |
|
20 | 32 |
|
21 | 33 | Perf.pageLoadEnd = Date.now(); |
22 | 34 |
|
23 | | - // report the time taken for a full app boot |
| 35 | + // report the time taken for a full app boot includes the time for |
| 36 | + // the jquery mobile js to load |
24 | 37 | Perf.report({ |
25 | 38 | datapoint: "fullboot", |
26 | 39 | value: Perf.pageLoadEnd - Perf.pageLoadStart |
27 | 40 | }); |
28 | 41 |
|
| 42 | + // report the time taken for the first page to be enhanced |
| 43 | + // pagecreate -> pageinit |
| 44 | + Perf.report({ |
| 45 | + datapoint: "enhancement", |
| 46 | + value: Perf.pageLoadEnd - Perf.pageEnhanceStart |
| 47 | + }); |
| 48 | + |
| 49 | + // report the time taken for the page to process. does *not* |
| 50 | + // inclue the load time for js |
| 51 | + // mobileinit -> pageinit |
| 52 | + Perf.report({ |
| 53 | + datapoint: "pageprocessing", |
| 54 | + value: Perf.pageLoadEnd - Perf.pageProcessingStart |
| 55 | + }); |
| 56 | + |
29 | 57 | // record the time taken to load and enhance the page |
30 | 58 | // start polling for a new revision |
31 | 59 | Perf.report({ |
|
0 commit comments