OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta name="viewport" content="user-scalable:no"> | 4 <meta name="viewport" content="user-scalable:no"> |
5 <style type="text/css"> | 5 <style type="text/css"> |
6 body { height: 1500px; } | 6 body { height: 1500px; } |
7 #center { | 7 #center { |
8 position: fixed; | 8 position: fixed; |
9 left: 40%;; | 9 left: 40%;; |
10 width: 50%; | 10 width: 50%; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 window.jankScriptDone = false; | 54 window.jankScriptDone = false; |
55 window.slowScriptDone = false; | 55 window.slowScriptDone = false; |
56 function waitMs(ms) { | 56 function waitMs(ms) { |
57 var startTime = window.performance.now(); | 57 var startTime = window.performance.now(); |
58 var currTime = startTime; | 58 var currTime = startTime; |
59 while (currTime - startTime < ms) { | 59 while (currTime - startTime < ms) { |
60 var currTime = window.performance.now(); | 60 var currTime = window.performance.now(); |
61 } | 61 } |
62 } | 62 } |
63 function makeJank() { | 63 function makeJank() { |
64 console.time('Interaction.JankThreadJSRun/is_responsive'); | 64 console.time('Interaction.JankThreadJSRun'); |
65 waitMs(jankMs); | 65 waitMs(jankMs); |
66 console.timeEnd('Interaction.JankThreadJSRun/is_responsive'); | 66 console.timeEnd('Interaction.JankThreadJSRun'); |
67 window.jankScriptDone = true; | 67 window.jankScriptDone = true; |
68 } | 68 } |
69 function makeSlow() { | 69 function makeSlow() { |
70 console.time('Interaction.SlowThreadJsRun/is_fast'); | 70 console.time('Interaction.SlowThreadJsRun'); |
71 waitMs(slowMs); | 71 waitMs(slowMs); |
72 console.timeEnd('Interaction.SlowThreadJsRun/is_fast'); | 72 console.timeEnd('Interaction.SlowThreadJsRun'); |
73 window.slowScriptDone = true; | 73 window.slowScriptDone = true; |
74 } | 74 } |
75 </script> | 75 </script> |
76 | 76 |
77 </head> | 77 </head> |
78 <body> | 78 <body> |
79 <div id="center"> | 79 <div id="center"> |
80 This is something in the middle. | 80 This is something in the middle. |
81 </div> | 81 </div> |
82 <div id="drawer"> | 82 <div id="drawer"> |
83 This is a drawer. | 83 This is a drawer. |
84 </div> | 84 </div> |
85 <button type="button" id="animating-button" onclick="makeAnimation()"> | 85 <button type="button" id="animating-button" onclick="makeAnimation()"> |
86 Click or tap this to trigger an animation. | 86 Click or tap this to trigger an animation. |
87 </div> | 87 </div> |
88 <button type="button" id="jank-button" onclick="makeJank()"> | 88 <button type="button" id="jank-button" onclick="makeJank()"> |
89 Click or tap this to make jank of 100ms (approximately). | 89 Click or tap this to make jank of 100ms (approximately). |
90 </div> | 90 </div> |
91 <button type="button" id="slow-button" onclick="makeSlow()"> | 91 <button type="button" id="slow-button" onclick="makeSlow()"> |
92 Click or tap this to make wait 200ms (approximately). | 92 Click or tap this to make wait 200ms (approximately). |
93 </div> | 93 </div> |
94 | 94 |
95 </body> | 95 </body> |
96 </html> | 96 </html> |
OLD | NEW |