In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: forked from: flash on 2012-4-11

correct implementation
Get Adobe Flash player
by Quasimondo 10 Apr 2012
    Embed
// 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);
        }
    }
}