]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | Ext.define('KitchenSink.profile.Base', {\r |
2 | extend: 'Ext.app.Profile',\r | |
3 | \r | |
4 | launch: function() {\r | |
5 | var isBenchmarking = window.location.search.match(/(\?|&)bm/);\r | |
6 | \r | |
7 | if (isBenchmarking) {\r | |
8 | Ext.Animator.on({\r | |
9 | animationend: 'onAnimationEnd',\r | |
10 | scope: this\r | |
11 | });\r | |
12 | \r | |
13 | this.benchmark = Ext.Viewport.add({\r | |
14 | style: 'background-color: red; color: #FFF',\r | |
15 | bottom: 0,\r | |
16 | right: 0,\r | |
17 | zIndex: 1000\r | |
18 | });\r | |
19 | }\r | |
20 | },\r | |
21 | \r | |
22 | onAnimationEnd: function(animator, animation, element) {\r | |
23 | var delay = (Date.now() - animation.startTime) - animation.getDuration(),\r | |
24 | benchmark = this.benchmark,\r | |
25 | item;\r | |
26 | \r | |
27 | item = benchmark.add({\r | |
28 | html: element.id + ' <b>' + delay + '</b>'\r | |
29 | });\r | |
30 | \r | |
31 | setTimeout(function() {\r | |
32 | item.destroy();\r | |
33 | }, 5000);\r | |
34 | }\r | |
35 | });\r |