Sha256: ee5b8e5cacfcc2de2d321059d5834682c7e6c5e7741a7d10a21ab7eea23f8768

Contents?: true

Size: 1.65 KB

Versions: 12

Compression:

Stored size: 1.65 KB

Contents

<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>

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
postrunner-0.0.10 misc/openlayers/tests/speed/wmscaps.html
postrunner-0.0.9 misc/openlayers/tests/speed/wmscaps.html
postrunner-0.0.8 misc/openlayers/tests/speed/wmscaps.html
postrunner-0.0.7 misc/openlayers/tests/speed/wmscaps.html
postrunner-0.0.6 misc/openlayers/tests/speed/wmscaps.html
postrunner-0.0.5 misc/openlayers/tests/speed/wmscaps.html
postrunner-0.0.4 misc/openlayers/tests/speed/wmscaps.html
gb_mapfish_appserver-0.0.5 vendor/assets/javascripts/openlayers/tests/speed/wmscaps.html
gb_mapfish_appserver-0.0.4 vendor/assets/javascripts/openlayers/tests/speed/wmscaps.html
gb_mapfish_appserver-0.0.3 vendor/assets/javascripts/openlayers/tests/speed/wmscaps.html
gb_mapfish_appserver-0.0.2 vendor/assets/javascripts/openlayers/tests/speed/wmscaps.html
gb_mapfish_appserver-0.0.1 vendor/assets/javascripts/openlayers/tests/speed/wmscaps.html