Created
November 6, 2015 21:43
-
-
Save cdata/0e97b6e4fa7d88fcdb49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <head> | |
| <base href="http://localhost:8888/components/test-benchmark/demo/"> | |
| <script src="../../webcomponentsjs/webcomponents-lite.js"></script> | |
| <script> | |
| (function SetupFrame() { | |
| 'use strict'; | |
| function Test () { | |
| this.startTime = -1; | |
| this.stopTime = -1; | |
| } | |
| Test.now = function () { | |
| if (window.performance && window.performance.now) { | |
| return window.performance.now(); | |
| } | |
| return Date.now(); | |
| } | |
| Test.prototype = { | |
| start: function () { | |
| this.startTime = Test.now(); | |
| }, | |
| stop: function () { | |
| this.stopTime = Test.now(); | |
| }, | |
| report: function () { | |
| window.parent.postMessage({ | |
| elapsed: this.stopTime - this.startTime | |
| }, '*'); | |
| } | |
| }; | |
| window.StartTest = function () { | |
| window.__simple_benchmark_test__ = new Test(); | |
| window.__simple_benchmark_test__.start(); | |
| }; | |
| window.EndTest = function () { | |
| window.__simple_benchmark_test__.stop(); | |
| window.__simple_benchmark_test__.report(); | |
| }; | |
| })(); | |
| </script> | |
| </head> | |
| <body> | |
| <link rel="import" href="//polygit.org/paper-button+polymerelements+v1.0.0/components/paper-button/paper-button.html"> | |
| <script> | |
| window.addEventListener("WebComponentsReady", function() { | |
| StartTest(); | |
| var component = document.createElement("paper-button"); | |
| document.body.appendChild(component); | |
| EndTest(); | |
| }); | |
| </script> | |
| </body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment