X-Git-Url: https://git.webkit.org/?p=WebKit.git;a=blobdiff_plain;f=PerformanceTests%2FSunSpider%2Ftests%2Fsunspider-1.0%2Fbitops-bits-in-byte.js;h=ebde79949293780e1865ccd4421aab7ef17a6d0d;hp=9a3acd4f77b1b4eb2585f7f9b892abac2f65c673;hb=dba95517ff51869626ae2f97dbb9a0dcbf7e717f;hpb=c6555fa39f63628cad9c73be586cd965c74019e4 diff --git a/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-bits-in-byte.js b/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-bits-in-byte.js index 9a3acd4..ebde799 100644 --- a/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-bits-in-byte.js +++ b/PerformanceTests/SunSpider/tests/sunspider-1.0/bitops-bits-in-byte.js @@ -1,6 +1,8 @@ // Copyright (c) 2004 by Arthur Langereis (arthur_ext at domain xfinitegames, tld com) +var result = 0; + // 1 op = 2 assigns, 16 compare/branches, 8 ANDs, (0-8) ADDs, 8 SHLs // O(n) function bitsinbyte(b) { @@ -14,8 +16,10 @@ return c; function TimeFunc(func) { var x, y, t; +var sum = 0; for(var x=0; x<350; x++) -for(var y=0; y<256; y++) func(y); +for(var y=0; y<256; y++) sum += func(y); +return sum; } -TimeFunc(bitsinbyte); +result = TimeFunc(bitsinbyte);