4 <meta name=
"viewport" content=
"user-scalable:no">
5 <style type=
"text/css">
6 body
{ height: 1500px; }
13 background-color: grey
;
14 -webkit-transform: scale
(0.25, 0.25);
15 -webkit-transition: -webkit-transform
1s;
24 background-color: red
;
25 -webkit-transform: translate3d
(-1000px, 0, 0);
26 -webkit-transition: -webkit-transform
1s;
32 window
.animationDone
= false;
33 function makeAnimation() {
34 var centerEl
= document
.querySelector('#center');
35 centerEl
.style
.webkitTransform
= 'scale(1.0, 1.0)';
36 console
.time('Interaction.CenterAnimation');
37 centerEl
.addEventListener('transitionend', function() {
38 console
.timeEnd('Interaction.CenterAnimation');
39 var drawerEl
= document
.querySelector('#drawer');
40 drawerEl
.style
.webkitTransform
= 'translate3D(0, 0, 0)';
41 console
.time('Interaction.DrawerAnimation');
42 drawerEl
.addEventListener('transitionend', function() {
43 console
.timeEnd('Interaction.DrawerAnimation');
44 window
.animationDone
= true;
54 window
.jankScriptDone
= false;
55 window
.slowScriptDone
= false;
57 var startTime
= window
.performance
.now();
58 var currTime
= startTime
;
59 while (currTime
- startTime
< ms
) {
60 var currTime
= window
.performance
.now();
64 console
.time('Interaction.JankThreadJSRun');
66 console
.timeEnd('Interaction.JankThreadJSRun');
67 window
.jankScriptDone
= true;
70 console
.time('Interaction.SlowThreadJsRun');
72 console
.timeEnd('Interaction.SlowThreadJsRun');
73 window
.slowScriptDone
= true;
80 This is something in the middle.
85 <button type=
"button" id=
"animating-button" onclick=
"makeAnimation()">
86 Click or tap this to trigger an animation.
88 <button type=
"button" id=
"jank-button" onclick=
"makeJank()">
89 Click or tap this to make jank of
100ms (approximately).
91 <button type=
"button" id=
"slow-button" onclick=
"makeSlow()">
92 Click or tap this to make wait
200ms (approximately).