add perf test
authorDan Vanderkam <danvdk@gmail.com>
Tue, 1 Dec 2009 16:03:13 +0000 (11:03 -0500)
committerDan Vanderkam <danvdk@gmail.com>
Tue, 1 Dec 2009 16:03:13 +0000 (11:03 -0500)
tests/perf.html [new file with mode: 0644]

diff --git a/tests/perf.html b/tests/perf.html
new file mode 100644 (file)
index 0000000..242d988
--- /dev/null
@@ -0,0 +1,35 @@
+<html>
+  <head>
+    <title>noise</title>
+    <!--[if IE]>
+    <script type="text/javascript" src="excanvas.js"></script>
+    <![endif]-->
+    <script type="text/javascript" src="../dygraph-combined.js"></script>
+    <script type="text/javascript" src="../dygraph-canvas.js"></script>
+    <script type="text/javascript" src="../dygraph.js"></script>
+    <script type="text/javascript" src="data.js"></script>
+  </head>
+  <body>
+    <div id="g" style="width:600px; height:300px;"></div>
+    <div id="status"></div>
+
+    <script type="text/javascript">
+      var num_tests = 10;
+      var start = new Date;
+
+      for (var i = 0; i < num_tests; i++) {
+        g = new Dygraph(
+              document.getElementById("g"),
+              NoisyData, {
+                rollPeriod: 7,
+                errorBars: true
+              }
+            );
+      }
+
+      var end = new Date;
+
+      document.getElementById("status").innerHTML = "Elapsed time: " + (end - start)/num_tests + " ms/instantiation";
+    </script>
+  </body>
+</html>