Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / test / data / dromaeo / tests / sunspider-access-nsieve.html
blob00dc1cc91e5280341346258b43a58ad94fe672fb
1 <html>
2 <head>
3 <script src="../htmlrunner.js"></script>
4 <script>
5 // The Great Computer Language Shootout
6 // http://shootout.alioth.debian.org/
7 //
8 // modified by Isaac Gouy
10 function pad(number,width){
11 var s = number.toString();
12 var prefixWidth = width - s.length;
13 if (prefixWidth>0){
14 for (var i=1; i<=prefixWidth; i++) s = " " + s;
16 return s;
19 function nsieve(m, isPrime){
20 var i, k, count;
22 for (i=2; i<=m; i++) { isPrime[i] = true; }
23 count = 0;
25 for (i=2; i<=m; i++){
26 if (isPrime[i]) {
27 for (k=i+i; k<=m; k+=i) isPrime[k] = false;
28 count++;
31 return count;
34 window.onload = function(){ startTest("sunspider-access-nsieve", 'efeee6f3');
36 test( "N-Sieve", function(){
37 for ( var i = 1; i <= 2; i++ ) {
38 var m = (1<<i)*10000;
39 var flags = Array(m+1);
40 nsieve(m,flags);
42 });
44 endTest(); };
45 </script>
46 </head>
47 <body></body>
48 </html>