OLD | NEW |
---|---|
(Empty) | |
1 <!doctype html> | |
2 | |
3 <!-- | |
4 Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
Jennifer Messerly
2014/03/19 19:27:57
2014?
Emily Fortuna
2014/03/24 19:45:56
Done.
| |
5 for details. All rights reserved. Use of this source code is governed by a | |
6 BSD-style license that can be found in the LICENSE file. | |
7 --> | |
8 | |
9 <html lang="en"> | |
10 <head> | |
11 <meta charset="utf-8"> | |
12 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
13 | |
14 <script type="application/javascript"> | |
15 | |
16 var startTime = new Date().getTime(); | |
Jennifer Messerly
2014/03/19 19:27:57
another possibly interesting start time is the var
Emily Fortuna
2014/03/24 19:45:56
Hm, would performance.timing.navigationStart be a
| |
17 var receivedTime = false; | |
18 function onReceive(e) { | |
19 if (!receivedTime) { | |
20 // This flag (receivedTime) is a band-aid because sometimes | |
21 // WebComponentsReady has already fired before Dart begins to execute | |
22 // in the Dartium test, so the test never completes. In compentation, | |
23 // we listen for both customElementsReady and also Polymer.onReady as | |
24 // a fallback case. | |
Jennifer Messerly
2014/03/19 19:27:57
any reason not to use Polymer.onReady also?
Emily Fortuna
2014/03/24 19:45:56
Done.
| |
25 receivedTime = true; | |
26 // Listen for a timestamp signifying when app startup is complete. | |
27 var endTime = e.data; | |
Jennifer Messerly
2014/03/19 19:27:57
another idea here, this code could be moved into D
Emily Fortuna
2014/03/24 19:45:56
I wrote it this way because I want to actually tim
| |
28 var startupTime = endTime - startTime; | |
29 document.body.innerHTML = 'The startup time is ' + startupTime + | |
30 ' milliseconds.'; | |
31 reportPerformanceTestDone(); | |
32 } | |
33 } | |
34 window.addEventListener('message', onReceive, true); | |
35 </script> | |
36 | |
37 <script src="packages/browser_controller/perf_test_controller.js"></script> | |
38 <title> TodoMVC • Startup Performance </title> | |
39 <link rel="stylesheet" href="app/app.css"> | |
40 <link rel="import" href="packages/polymer/polymer.html"> | |
41 <link rel="import" href="lib-elements/polymer_localstorage.html"> | |
42 <link rel="import" href="elements/td_model.html"> | |
43 <link rel="import" href="elements/td_todos.html"> | |
44 </head> | |
45 <body> | |
46 <header> | |
47 <h1>todos</h1> | |
48 </header> | |
49 <polymer-localstorage id="storage" name="todos-polymer"> | |
50 </polymer-localstorage> | |
51 <td-model id="model" storageId="storage"></td-model> | |
52 <td-todos modelId="model"></td-todos> | |
53 <script type="application/dart" src="performance.dart"></script> | |
54 <footer id="info"> | |
55 <p>Double-click to edit a todo</p> | |
56 <p>Created by <a href="https://www.dartlang.org/polymer-dart/"> | |
57 The Polymer.dart Authors</a></p> | |
58 <p>This example was built using a pre-alpha version of Polymer.dart.</p> | |
59 <p>Part of <a href="http://todomvc.com">TodoMVC</a></p> | |
60 </footer> | |
61 </body> | |
62 </html> | |
OLD | NEW |