]> dev.renevier.net Git - syp.git/blob - openlayers/tests/speed/string_format.html
fixes notices
[syp.git] / openlayers / tests / speed / string_format.html
1 <html>
2 <head>
3 <script src="../../lib/OpenLayers.js"></script>
4 <script>
5
6 function stringformat() {
7   var string = OpenLayers.String.format("${abc} 123 ${def}", {'abc': 456, 'def': 789}) 
8 }    
9 function run(x) {
10     var date = new Date();
11     for (var i = 0; i < x; i++) {
12         stringformat();
13     }
14     var elapsed = (new Date() - date);
15     return elapsed;
16 }
17
18 function show_time(x) 
19 {
20     var t = run(x);
21     document.getElementById("out").innerHTML = t + "ms  for " + x + " runs";
22 }
23 </script>
24 </head>
25 <body>
26 <a onclick="javascript:show_time(100000); return false" href="#">Run</a>
27 <div id="out"></div>
28 </body>
29 </html>