8 Copyright (C) 2007 Apple Inc. All rights reserved.
10 Redistribution and use in source and binary forms, with or without
11 modification, are permitted provided that the following conditions
13 1. Redistributions of source code must retain the above copyright
14 notice, this list of conditions and the following disclaimer.
15 2. Redistributions in binary form must reproduce the above copyright
16 notice, this list of conditions and the following disclaimer in the
17 documentation and/or other materials provided with the distribution.
19 THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
20 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 <title>SunSpider 1.0.2 JavaScript Benchmark (sunspider-1.0.2 test suite - In Progress...)</title>
33 <link rel="stylesheet" href="../sunspider.css">
36 <body onload="start()">
38 <h2><span id="logo">☀</span>SunSpider JavaScript Benchmark <small>(In Progress...)</small></h2>
39 <h3>Content Version: sunspider-1.0.2</h3>
41 <script src="sunspider-test-prefix.js"></script>
42 <script src="sunspider-test-contents.js"></script>
45 var currentRepeat = -1;
50 output.length = repeatCount;
51 for (var i = 0; i < output.length; i++) {
57 for (var start = new Date; new Date - start < warmupMS; ) {
58 for (var i = 0; i < 100; ++i) {
59 if (Math.atan(Math.acos(Math.asin(Math.random()))) > 4) // Always false.
67 window.setTimeout(next, 128);
72 document.getElementById("frameparent").innerHTML = "";
73 document.getElementById("frameparent").innerHTML = "<iframe id='testframe'>";
74 var testFrame = document.getElementById("testframe");
75 if (++testIndex < tests.length) {
76 // Warm up the CPU a little bit, in case power management clocked it down
77 // or put it to sleep. We're trying to strike a balance here: do enough
78 // work so that all browsers see the CPU at an equal clock rate, but
79 // not so much work that we hide performance problems caused by overly
80 // aggressive power management.
83 testFrame.contentDocument.open();
84 testFrame.contentDocument.write(testContents[testIndex]);
85 testFrame.contentDocument.close();
87 window.setTimeout(next, 0);
88 } else if (++currentRepeat < repeatCount) {
89 document.getElementById("countdown").innerHTML = repeatCount - currentRepeat;
92 window.setTimeout(next, 128);
98 function recordResult(time)
100 if (currentRepeat >= 0) // negative repeats are warmups
101 output[currentRepeat][tests[testIndex]] = time;
106 var outputString = "{";
107 outputString += '"v": "sunspider-1.0.2", ';
108 for (var test in output[0]) {
109 outputString += '"' + test + '":[';
110 for (var i = 0; i < output.length; i++) {
111 var time = output[i][test];
114 outputString += time + ",";
116 outputString = outputString.substring(0, outputString.length - 1);
117 outputString += "],";
119 outputString = outputString.substring(0, outputString.length - 1);
122 location = "results.html?" + encodeURI(outputString);
127 <h3 id="countdown">warmup</h3>
128 <div id="frameparent"></div>