Skip to content

Commit ba10967

Browse files
committed
Add timing information to test.
1 parent 5cbc3c5 commit ba10967

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test-tile.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
<title>Test tileFor()title>
33
<meta charset="UTF-8">
44
<script src="tzmap.js">script>
5+
<style>
6+
canvas { vertical-align: middle }
7+
style>
58
<script>
69
window.tzmap.loadData("./", run, function() { alert("loading failed") });
710

@@ -16,8 +19,12 @@
1619
lats[i] = 50 - i / 20;
1720
}
1821

22+
var startTime = Date.now();
1923
var canvas = window.tzmap.tileFor(lats, lons, [{color: "red", polygons: polygons}]);
24+
var duration = Date.now() - startTime;
2025
canvas.style.border = "1px solid black";
2126
document.body.appendChild(canvas);
27+
document.body.appendChild(document.createTextNode(" drawn in " + duration + "ms."));
28+
document.body.appendChild(document.createElement("br"));
2229
}
2330
script>

0 commit comments

Comments
 (0)