// forked from makc3d's forked from: flash on 2012-4-11 // forked from makc3d's flash on 2012-4-11 // correct implementation package { import com.actionscriptbible.Example; import flash.utils.getTimer; public class FlashTest extends Example { public function FlashTest() { var a:int,b:int,result:int,j:int, t:int = getTimer (); for ( j = 0; j < 10000; j ++ ) { for (a = 0; a < 256; a++) { for (b = 0; b < 256; b++) { result = (a * b) / 255; } } } trace (getTimer () - t); t = getTimer (); for ( j = 0; j < 10000; j ++ ) { for (a = 0; a < 256; a++) { for (b = 0; b < 256; b++) { var i:int = a * b + 128; result = (i+(i>>8))>>8; } } } // https://twitter.com/#!/quasimondo/status/189728898014126080 trace (getTimer () - t); } } } forked from: forked from: flash on 2012-4-11