diff options
author | Chris Schlaeger <chris@linux.com> | 2015-10-17 21:36:38 +0200 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2015-10-17 21:36:38 +0200 |
commit | e30f267181d990947e67909de4809fa941698c85 (patch) | |
tree | 46e9f94c2b3699ed378963b420b8a8d361286ea1 /misc/openlayers/tests/speed/wmscaps.html | |
parent | e763ceb183f389fcd314a4a6a712d87c9d4cdb32 (diff) | |
download | postrunner-e30f267181d990947e67909de4809fa941698c85.zip |
Upgrading openlayers to 3.x
Diffstat (limited to 'misc/openlayers/tests/speed/wmscaps.html')
-rw-r--r-- | misc/openlayers/tests/speed/wmscaps.html | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/misc/openlayers/tests/speed/wmscaps.html b/misc/openlayers/tests/speed/wmscaps.html deleted file mode 100644 index 3cab542..0000000 --- a/misc/openlayers/tests/speed/wmscaps.html +++ /dev/null @@ -1,52 +0,0 @@ -<html> - <head> - <title>WMS Capabilities Speed Test</title> - <script src="../../lib/OpenLayers.js"></script> - <script src="wmscaps.js"></script> - <script> - var data; - var stats = []; - - function parseCaps(id, done) { - var format = new OpenLayers.Format.WMSCapabilities(); - data = format.read(caps); - done(id); - } - - function run(func, x) { - document.getElementById("out").innerHTML = "running ..."; - var starts = {}; - var elapsed = 0; - completed = 0; - function callback(id) { - elapsed += new Date() - starts[id]; - ++completed; - if (completed === x) { - report(x, elapsed); - } - } - var runner; - for (var i=0; i<x; i++) { - runner = createRunner(i, starts, func, callback); - window.setTimeout(runner, 0); - } - } - - function createRunner(id, starts, func, done) { - return function() { - starts[id] = new Date(); - func(id, done); - } - } - - function report(x, elapsed) { - document.getElementById("out").innerHTML = elapsed + " ms for " + x + " runs (" + elapsed/x + " ms average)"; - } - - </script> - </head> - <body> - <a onclick="javascript:run(parseCaps, 5); return false" href="#">Run</a> - <div id="out"></div> - </body> -</html> |